Skip to main content

Manage team profiles

Create the profiles your integration writes with, such as your community team or your brand accounts, and keep them up to date. These endpoints need the PROFILE_MANAGEMENT permission.

info

These endpoints only act on profiles linked to your Dashboard. Members who signed up through your app cannot be edited through the API, unless the Octopus team linked their profile at your request.

To ban or hide any member, including one who signed up through your app, see Moderate and curate.

Create a profile​

POST /v1/users creates a member profile in your community. The profile is linked to your Dashboard right away, so you can publish in its name immediately.

Parameters

  • nickname (required): the display name. It must not be taken in your community.
  • bio (optional): the member's biography.
  • adminTag (optional): true also sets the admin tag.
  • imageBase64 (optional): a profile picture, see Profile picture.
curl https://connect.octopuscommunity.com/v1/users \
--header "Authorization: Bearer $CONNECT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"nickname": "The Recipe Team",
"bio": "Our chefs answer your questions every week.",
"adminTag": true
}'
{
"userId": "<USER_ID>",
"nickname": "The Recipe Team",
"adminTag": true,
"picture": false,
"warnings": []
}

Keep the userId: it is the id every write endpoint takes to act in this member's name.

  • 409 Conflict: the nickname is already taken.
  • 502 Bad Gateway: the creation failed, and Octopus removes the member it started to create. Retry the request. In rare cases that removal fails too, and the retry answers 409: contact the Octopus team.
  • 201 with warnings: the member was created, but the admin tag (ADMIN_TAG_NOT_SET) or the picture (PICTURE_NOT_SET) could not be set. Set it again on its own with PUT /v1/users/{id}/admin-tag or PATCH /v1/users/{id}.
info

The member also appears in your Dashboard, and members of the community see it like any other profile.

Edit a profile​

PATCH /v1/users/{id} changes the nickname, the bio and the profile picture of a member. The member must be linked to your Dashboard.

Parameters

  • id (path): the member's userId.
  • nickname (optional): the new display name. Leave it out to keep the current one.
  • bio (optional): the new biography. Leave it out to keep the current one.
  • imageBase64 (optional): a new profile picture, see Profile picture.
  • removePicture (optional): true removes the current picture. It cannot be combined with imageBase64.
curl --request PATCH "https://connect.octopuscommunity.com/v1/users/<USER_ID>" \
--header "Authorization: Bearer $CONNECT_API_KEY" \
--header "Content-Type: application/json" \
--data '{"bio": "Our chefs answer your questions every Tuesday."}'
{
"userId": "<USER_ID>",
"nickname": null,
"bio": "Our chefs answer your questions every Tuesday.",
"pictureUpdated": false
}

nickname and bio are null in the response when you did not change them. pictureUpdated tells whether a picture was set or removed.

  • 409 Conflict: a picture sent earlier is still being processed. Nothing was changed: wait a few seconds and retry.
  • 502 Bad Gateway: the picture could not be stored on our side. Nothing was changed: retry.

Profile picture​

imageBase64, on both POST /v1/users and PATCH /v1/users/{id}, takes the picture's bytes encoded in base64, without a data: prefix:

  • Formats: jpg, png, webp and gif. webp and gif are converted on the way in, keeping their transparency. Only the first frame of an animated picture is kept.
  • Size: at most 50 MB once decoded (limits.imageMaxBytes in GET /v1/config).
  • Dimensions: each side between 50 and 4,000 pixels, and the longer side at most 32:9 times the shorter one (limits.profilePicture).

A picture outside these limits answers 400, and on POST /v1/users no member is created.

A picture of a few megabytes is too long to pass as a command-line argument, so stream the JSON body to curl instead:

{ printf '{"imageBase64": "'; base64 < avatar.png | tr -d '\n'; printf '"}'; } |
curl --request PATCH "https://connect.octopuscommunity.com/v1/users/<USER_ID>" \
--header "Authorization: Bearer $CONNECT_API_KEY" \
--header "Content-Type: application/json" \
--data-binary @-
info

A new picture is processed asynchronously: avatarUrl on GET /v1/users/profile keeps returning the previous picture (or null for a new member) for a short while. Poll it until it changes. Removing a picture with removePicture: true takes effect immediately.

Set or remove the admin tag​

PUT /v1/users/{id}/admin-tag sets or removes the admin tag of a member. The tag is cosmetic: it shows a badge on the member's profile and content, and grants no moderation power. The member must be linked to your Dashboard.

Parameters

  • id (path): the member's userId.
  • admin (required): true sets the tag, false removes it.
curl --request PUT "https://connect.octopuscommunity.com/v1/users/<USER_ID>/admin-tag" \
--header "Authorization: Bearer $CONNECT_API_KEY" \
--header "Content-Type: application/json" \
--data '{"admin": true}'
{"userId": "<USER_ID>", "admin": true}