Graine AI
API referenceWorkflows

Add contacts to a workflow campaign

Each contact becomes a queued run; the ones the workflow cannot take come back with why.

Each contact becomes a queued run; the ones the workflow cannot take come back with why. Only before the campaign starts (a new list after that is a new campaign).

Rate limit: 2000 requests per minute per organization, counted together with every endpoint that has no stricter limit of its own. Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.

POST
/v2/workflow-campaigns/{workflow_campaign_id}/entries
/v2/workflow-campaigns/ocm_4e1f9a2b6c7d8e9f0a1b2c3d/entries

The Authorization access token

Authorization

Authorization
Required
Bearer <token>

Your Graine API key. Create one in the dashboard under Developers, or via POST /v2/api-keys. Send it as Authorization: Bearer <key>.

In: header

Request Body

application/jsonRequired

contacts
Required
Contacts

Up to 5000 contacts a request.

Path Parameters

workflow_campaign_id
Required
Workflow Campaign Id

The workflow campaign's id.

Response Body

200

Added, and the ones refused.

added
Required
Added

Contacts added.

refused
Required
Refused

The ones refused, with why.

401

1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

403

1102 — the key is valid but lacks the scope this endpoint requires, or names another organization. GET /v2/scopes reports what a key holds.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

404

1200 — no such resource in your organization. A resource belonging to another organization answers 404, never 403.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

409

1201 — the resource's current state does not allow this action.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

422

1001 — the body or query failed validation; the message names the first offending field.

error
Required
integer

Stable integer code from the error table. Branch on this, not on the message.

message
Required
string

One human-readable sentence. Wording may change; the code will not.

429

1300 — the per-organization request rate or concurrent-call limit was reached. Carries Retry-After.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

curl -X POST "https://api.graine.ai/v2/workflow-campaigns/ocm_4e1f9a2b6c7d8e9f0a1b2c3d/entries" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "contacts": [
      {
        "mobile_number": "+919876543210",
        "plan": "gold"
      }
    ]
  }'

Added, and the ones refused.

{
  "added": 498,
  "refused": []
}