RaabtaHQ
Add a library instruction

Add a library instruction

POST/api/v1/instructions

scope assistants:writeIdempotent

Adds an instruction to the library. It does nothing until an assistant is bound to it with PUT /assistants/{id}/instructions.

Body

application/json
NameTypeDescription
titlerequired
stringLibrary title
descriptionrequired
stringOne line on when it applies
contentrequired
stringThe instruction text
Request
curl -X POST "https://your-crm.example.com/api/v1/instructions" \
  -H "Authorization: Bearer $RAABTA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2a9e-3b4d-4c5e-8f7a-9b0c1d2e3f4a" \
  -d '{
    "title": "Refund policy",
    "description": "How to answer anyone asking about refunds or cancellations",
    "content": "Treatments cancelled more than 24 hours ahead are refunded in full. Inside 24 hours we offer a reschedule, not a refund. Never promise an exception — hand off instead."
  }'
Response · 201 Created
{
  "data": {
    "id": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
    "title": "Refund policy",
    "description": "How to answer anyone asking about refunds or cancellations",
    "content": "Treatments cancelled more than 24 hours ahead are refunded in full. Inside 24 hours we offer a reschedule, not a refund. Never promise an exception — hand off instead.",
    "assistant_count": 2,
    "created_at": "2026-08-02T10:00:00.000Z",
    "updated_at": "2026-08-20T14:00:00.000Z"
  }
}

Response

Wrapped in { data: … }
NameTypeDescription
idrequired
string (uuid)Instruction id
titlerequired
stringLibrary title
descriptionrequired
stringOne line on when it applies
contentrequired
stringThe instruction text given to the model
assistant_countrequired
integerAssistants this instruction is bound to
created_atrequired
string (date-time)When it was created
updated_atrequired
string (date-time)When it was last edited

Errors

StatusCodeWhen
400bad_requestThe request could not be parsed: malformed JSON, an invalid cursor, or a query parameter of the wrong shape.
400validation_errorThe body or query failed validation. `details` lists each failing field with a `path` and a `message`.
401unauthorizedNo usable API key: the Authorization header is missing or malformed, or the key is unknown, revoked or expired. The three are deliberately indistinguishable.
403forbiddenThe key is valid but lacks the scope this endpoint requires, or the request came from an address outside the key’s IP allowlist. The message says which.
403account_suspendedThe account this key belongs to is suspended. Rotating the key will not help; contact support.
409conflictThe request conflicts with current state: a duplicate phone number on create, an invalid state transition, or an idempotent request that is still in flight.
422unprocessableThe request was well-formed but cannot be carried out. `reason` is a stable string saying why (for example `outside_window` or `stage_not_in_pipeline`).
429rate_limitedThe per-key budget, or the per-IP budget for failed authentication, is exhausted. Honour `Retry-After` before retrying.
500internalSomething failed on our side. Safe to retry with the same Idempotency-Key; quote `request_id` if it persists.