Skip to main content

Authentication and permissions

Every request carries a Connect API key. The key tells Octopus which community you act on, and which write operations you may perform.

Get a Connect API key​

Your Connect API keys are listed in your Octopus Community Dashboard, under Community settings > Keys & secrets > Connect API keys. A key with no write permission is marked Read-only.

  • No key yet? Click Request a Connect API key, pick the permissions you need and describe what you want to build. The Octopus team gets back to you and creates the key.
  • Need other permissions on an existing key? Click Need different permissions? on the same card and send a new request.

A key belongs to one community. You never pass a community id: every request acts on the key's community.

warning

The Connect API key is different from the SDK API key that your app uses: a call to the Connect API with an SDK API key fails.

Treat the key like a password and keep it on your servers only.

Authenticate requests​

Send the key in the Authorization header with the Bearer scheme, on every request, over HTTPS:

curl https://connect.octopuscommunity.com/v1/messages/topics \
--header "Authorization: Bearer $CONNECT_API_KEY"

The Connect API secret key is an opaque string with no fixed prefix or format. Send it exactly as you received it, after Bearer in the Authorization header.

  • No Authorization header: 401 Unauthorized.
  • A key that does not exist: 403 Forbidden.

Write permissions​

Reading needs only a valid key. Each write endpoint also needs one permission on the key, and answers 403 Forbidden with "error": "MISSING_PERMISSION" when the key does not have it.

PermissionWhat it allowsEndpoints
CONTENT_WRITEPublish, react, vote and delete content in the name of a Dashboard-linked profilePOST /v1/messages/posts, /bridge-posts, /comments, /replies, DELETE /v1/messages/{id}, PUT and DELETE /v1/messages/{id}/reaction, PUT /v1/messages/{id}/vote
SCHEDULINGQueue posts for later in the name of a Dashboard-linked profile, then list, edit or cancel them/v1/scheduled-posts (all methods)
PROFILE_MANAGEMENTCreate Dashboard-linked profiles, edit them, set their admin tagPOST /v1/users, PATCH /v1/users/{id}, PUT /v1/users/{id}/admin-tag
MODERATIONHide or moderate any content, ban or hide any memberPOST /v1/messages/{id}/hide, /moderate, POST /v1/users/{id}/ban, /hide
CURATIONRank or pin a post, or move it to another topicPOST /v1/messages/{id}/boost, PUT /v1/messages/{id}/topic
NOTIFYNotify every member about a postPOST /v1/messages/{id}/notify

The media upload endpoints (POST /v1/media/images, POST /v1/media/videos, GET /v1/media/videos/{videoId}) accept either CONTENT_WRITE or SCHEDULING, since both direct and scheduled posts can carry media.

Check what your key can do​

GET /v1/config returns the write permissions of the key you call it with, the reactions your community accepts, the limits the write endpoints enforce, and your community's language settings. It needs no permission, so a read-only key can call it too: its writePermissions is empty.

curl https://connect.octopuscommunity.com/v1/config \
--header "Authorization: Bearer $CONNECT_API_KEY"
{
"reactions": ["❤️", "😂", "😮", "👏", "😢", "😡"],
"writePermissions": ["CONTENT_WRITE", "PROFILE_MANAGEMENT", "SCHEDULING"],
"limits": {
"poll": {"minAnswers": 2, "maxAnswers": 7, "maxAnswerLength": 100},
"imageMaxBytes": 52428800,
"scheduledPostImageMaxBytes": 10485760,
"feedPageSize": {"default": 5, "max": 20},
"scheduledPostsPageSize": {"default": 20, "max": 100},
"profilePicture": {"minDimensionPx": 50, "maxDimensionPx": 4000, "maxSideRatio": 3.5555555555555554}
},
"languages": ["en", "fr"],
"defaultLanguage": "en",
"informalLanguages": ["fr"]
}

The three language fields are your community's settings from the Dashboard, the same for every key of your community:

  • languages: your community's languages, as lowercase codes such as en, fr or zh-cn. Empty when none is set.
  • defaultLanguage: one of languages, given to members whose own language is not among them. An empty string when languages is empty.
  • informalLanguages: the languages, among languages, in which the Octopus Community texts shown in your app address members informally, for example "tu" rather than "vous" in French. Empty when every language is formal, which is the default.

If your community's settings cannot be read, the call answers 503 Service Unavailable: retry shortly.

tip

Call it once when your integration starts, instead of hardcoding these values: reactions vary per community and permissions per key, and the limits are the ones the endpoints actually enforce. A surprising 400 or 403 usually comes from a gap between your assumption and this response.

Linked profiles​

Most write endpoints act in the name of a member, and only of a profile linked to your Dashboard: you pass the member's userId, and the content, reaction or vote is theirs. Octopus only lets your key act in the name of a member whose profile is linked to your Octopus Community Dashboard. Members who signed up through your app are not linked, so your integration cannot write in their name unless the Octopus team links their profile (see below).

A profile is linked when:

  • you created it with POST /v1/users: it is linked right away;
  • or you created it from the Dashboard: it is linked right away;
  • or the Octopus team attached an existing member's profile to a Dashboard account, at your request.

You cannot link an existing member yourself, through the API or the Dashboard: contact the Octopus team. This also applies to a profile that looks attached in your Dashboard but still answers 403.

Calling an endpoint in the name of a profile that is not linked answers 403 Forbidden. The message says that the profile is not linked, which tells it apart from a missing permission. The one exception is POST /v1/scheduled-posts, which answers 404 Not Found for an author that is not linked.

These endpoints act in the name of a Dashboard-linked profile (the userId must be linked):

  • Create a post, bridge post, comment or reply
  • Delete a message (its author must be linked)
  • Add or remove a reaction, vote on a poll
  • Edit a profile, set its admin tag
  • Create a scheduled post

These endpoints act as your integration and need no linked profile:

  • Hide, show or moderate a message
  • Ban or hide any member
  • Boost a post, move it to another topic
  • Notify the community about a post

The userId is the member's Octopus user id. You get it in the response of POST /v1/users, as createdBy.userId on any message they wrote, or as profile.id from GET /v1/users/profile.