Farcaster API
Send Cast
Get Started
- Quickstart
- Frameworks
- LLM Docs
Account Management
IPFS
- Pinning Files
- Groups
- Listing Files
- Metadata & Options
- Deleting Files
- Signatures
- Dedicated Gateways
- IPFS 101
- Tools
Private IPFS
Farcaster
- Farcaster
- Getting Started
- Dev Tools
- Farcaster API
- Farcaster Auth
- Frame Analytics API
- Hub API Reference
Farcaster API
Send Cast
POST
/
casts
curl --request POST \
--url https://api.pinata.cloud/v3/farcaster/casts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"castAddBody": {
"text": "<string>",
"parentUrl": "<string>",
"embeds": [
{
"url": "<string>",
"castId": {
"fid": 123,
"hash": "<string>"
}
}
],
"mentions": [
123
],
"mentionsPositions": [
123
],
"parentCastId": {
"fid": 123,
"hash": "<string>"
}
},
"signerId": "<string>"
}'
{
"data": {
"data": {
"type": "MESSAGE_TYPE_CAST_ADD",
"fid": 401191,
"timestamp": 102505958,
"network": "FARCASTER_NETWORK_MAINNET",
"castAddBody": {
"embedsDeprecated": [],
"mentions": [],
"text": "Hello World!",
"mentionsPositions": [],
"embeds": []
}
},
"hash": "0xb3668292af912397fad6b8457223e75c04221992",
"hashScheme": "HASH_SCHEME_BLAKE3",
"signature": "U40EB6YqZNI/AdNrXLyk7jjh+U/XdHe6fWTX28IDX6PJQTfG+7cJX/dUtrOzNfvCojEUqaaks3a+oPBPU7jVAw==",
"signatureScheme": "SIGNATURE_SCHEME_ED25519",
"signer": "0x86367a36c3c181c46acdc6027109dbaa75c5fbc97c500af23f1ea8c987f12375",
"dataBytes": "CAEQp74YGOa78DAgASoOIgxIZWxsbyBXb3JsZCE="
}
}
The body of sending a cast is made up of primarily two pieces. One is the signerId
provided by using Farcaster Auth. The other is the castAddBody
object which follows the same pattern of Farcaster Hubs when submitting a cast.
body = JSON.stringify({
castAddBody: {
text: "Hello World!", // Just a plain text cast
parent_url: "https://warpcast.com/~/channel/pinata", // What channel you want to cast in
embeds: [ // An array of embeds, including links or quote casting
{ // URLs or links are just an object with the url
url: "https://dweb.mypinata.cloud/ipfs/QmYSzs7WczucVrPN2CZcZeEzyGRDrxrFEWGtYA32jz2L3U?filename=sendit.gif"
},
{// Quote casting includes a castId object with the hash of the cast and the FID of the user who sent it
castId: {
fid: 6023,
hash: "0xb3668292af912397fad6b8457223e75c04221992"
}
}
],
mentions: [6023], // An array of FIDs to mention someone in a post
mention_positions: [2], // An array of positions where the mentions should be placed in order of appearance
parent_cast_id: { // Used when replying to a cast, same casdId struct used in embeds
fid: 6023,
hash: "0xb3668292af912397fad6b8457223e75c04221992"
}
},
signerId: "e5cf5d84-7671-4402-8df0-84b0efdc24cd" // The signerId of the user sending a cast, already approved via Farcaster Auth
})
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200 - application/json
OK
The response is of type object
.
curl --request POST \
--url https://api.pinata.cloud/v3/farcaster/casts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"castAddBody": {
"text": "<string>",
"parentUrl": "<string>",
"embeds": [
{
"url": "<string>",
"castId": {
"fid": 123,
"hash": "<string>"
}
}
],
"mentions": [
123
],
"mentionsPositions": [
123
],
"parentCastId": {
"fid": 123,
"hash": "<string>"
}
},
"signerId": "<string>"
}'
{
"data": {
"data": {
"type": "MESSAGE_TYPE_CAST_ADD",
"fid": 401191,
"timestamp": 102505958,
"network": "FARCASTER_NETWORK_MAINNET",
"castAddBody": {
"embedsDeprecated": [],
"mentions": [],
"text": "Hello World!",
"mentionsPositions": [],
"embeds": []
}
},
"hash": "0xb3668292af912397fad6b8457223e75c04221992",
"hashScheme": "HASH_SCHEME_BLAKE3",
"signature": "U40EB6YqZNI/AdNrXLyk7jjh+U/XdHe6fWTX28IDX6PJQTfG+7cJX/dUtrOzNfvCojEUqaaks3a+oPBPU7jVAw==",
"signatureScheme": "SIGNATURE_SCHEME_ED25519",
"signer": "0x86367a36c3c181c46acdc6027109dbaa75c5fbc97c500af23f1ea8c987f12375",
"dataBytes": "CAEQp74YGOa78DAgASoOIgxIZWxsbyBXb3JsZCE="
}
}