Skip to content
Connect an agent

Profiles

Create a profile

A profile keeps one of your customers' accounts apart from the rest of the workspace.

POST/v1/profiles

TL;DR

QuestionAnswer
What does it do?Create a profile.
What does it need?An API key or an OAuth access token.
What does it take?A JSON body with the fields below, and idempotency-key in a header.
What does it return?Status 201 with a body of type Profile.
In the SDK?flung.profiles.create()
As an MCP tool?create_profile
What can go wrong?401 Missing, unknown, revoked or expired API key; 409 Another profile already has this external id; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape.

What it does

A profile keeps one of your customers' accounts apart from the rest of the workspace. Make a connect token with its profileId, and the accounts that customer connects join it; list them with GET /v1/accounts?profileId=.

Example

curl
curl -X POST 'https://api.flung.dev/v1/profiles' \  --header "Authorization: Bearer $FLUNG_API_KEY" \  --header 'Content-Type: application/json' \  --header "Idempotency-Key: $(uuidgen)" \  --data '{  "name": "Acme Studio",  "externalId": "user_8412"}'

A successful answer looks like this:

json
{  "id": "prof_aaaaaaaaaaaaaaaaaaaaaaaa",  "name": "string",  "externalId": "string",  "createdAt": "2026-11-01T09:00:00.000Z",  "updatedAt": "2026-11-01T09:00:00.000Z"}

Header parameters

FieldTypeRequiredDescription
idempotency-keystringnoAny unique string, such as a UUID. A retry with the same key and body within 24 hours gets the first answer instead of running again.

Request body

The body has the type an object, with the fields below.

FieldTypeRequiredDescription
namestringyesA name for people to read, such as your customer's name. Letters and digits of every script, spaces, and - _ . ' & ( ) +. No emoji, other symbols or invisible characters. Runs of spaces become one and the ends are trimmed. It must hold a letter or a digit, and may not be profane. at least 1 character; at most 200 characters.
externalIdstringnoYour own id for this customer, such as their user id. Unique in the workspace, so you can find the profile again by it. at least 1 character; at most 255 characters.

Responses

StatusMeaningBody
201The profile.Profile
401Missing, unknown, revoked or expired API key.Error
409Another profile already has this external id.Error
422The request failed validation.Error
429Too many requests for this credential; wait for retry-after seconds.Error

Response body

A 201 answer has the type Profile.

FieldTypeRequiredDescription
idstringyes
namestringyes
externalIdstring | nullyes
createdAtstringyes
updatedAtstringyes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it
create_profileThe same operation as an MCP tool