Docs menuAI instructions

AI instructions

GET /api/v1/instructions

The user's saved AI instructions, as Settings → AI instructions and each account's page hold them: writer and assistant ({text, enabled}) and per account its own instructions, use_writing_profile, writing_profile_ready, bio, writing_profile and posting_language. Free.

  • Scopepostory:read
  • Limit classREAD
  • Success200

Example

Request
curl https://postory.io/api/v1/instructions \
  -H "Authorization: Bearer $POSTORY_API_KEY"
Response 200
{"changed": ["<changed>"], "settings_url": "<settings_url>"}

Other responses

401

No API key, or an invalid or revoked one

403

The key lacks the scope, or access is paused

422

A request parameter is not valid

429

Rate limit spent; see Retry-After

PATCH /api/v1/instructions

Change the AI instructions; only what is sent changes. Every check runs first: a refused request changes nothing, and a value already so is a success. Answers the settings, with changed.

  • Scopepostory:drafts
  • Limit classWRITE
  • Success200

Request body

FieldTypeDescription
account_instructionsstring

That account's own writer instructions. REPLACES that whole text ("" clears it), up to 2,000 characters; turns nothing on or off.

Up to 2000 characters
assistantstring

How Postory's chat answers. REPLACES that whole text ("" clears it), up to 2,000 characters; turns nothing on or off.

Up to 2000 characters
assistant_enabledboolean

Whether the assistant instructions apply.

biostring

That account's About you, private context for drafts (up to 2,000 characters): the user's own; "" returns it to the bio Postory reads.

Up to 2000 characters
connection_idstring

The account the account fields below change (GET /accounts).

Up to 36 characters
posting_languagestring

The language that account's new posts are written in (Spanish); "" reads it from the posts again.

Up to 64 characters
use_writing_profileboolean

Fit that account's drafts to its writing profile (its page's switch). On needs a plan with it (403 plan_required) and a ready profile (409 writing_profile_not_ready, with settings_url).

writerstring

How Postory writes posts. REPLACES that whole text ("" clears it), up to 2,000 characters; turns nothing on or off.

Up to 2000 characters
writer_enabledboolean

Whether the writer instructions apply.

writing_profilestring

That account's writing profile text (up to 4,000 characters): the user's own; "" returns it to the profile Postory builds from the posts.

Up to 4000 characters

Example

Request
curl -X PATCH https://postory.io/api/v1/instructions \
  -H "Authorization: Bearer $POSTORY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"account_instructions": "<account_instructions>"}'
Response 200
{"changed": ["<changed>"], "settings_url": "<settings_url>"}

Other responses

401

No API key, or an invalid or revoked one

403

The key lacks the scope, or access is paused

404

Not found, or not this user's

409

The state does not allow it now (already scheduled, changed, needs a choice…); branch on code

422

A request parameter is not valid, or an account's network does not take what the post asks: capability_unsupported (network, capability, capability_state, connection_id), e.g. a first comment on a post only for LinkedIn. A shared first comment on a post for several networks is fine: only the accounts whose network takes one send it

429

Rate limit spent; see Retry-After