Profiles
Change a profile
Its name or its external id.
PATCH
/v1/profiles/{id}TL;DR
| Question | Answer |
|---|---|
| What does it do? | Change 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 id in the path. |
| What does it return? | Status 200 with a body of type Profile. |
| In the SDK? | flung.profiles.update() |
| What can go wrong? | 401 Missing, unknown, revoked or expired API key; 404 No such profile in this workspace; 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. |
Example
curl
curl -X PATCH 'https://api.flung.dev/v1/profiles/prof_aaaaaaaaaaaaaaaaaaaaaaaa' \ --header "Authorization: Bearer $FLUNG_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "name": "Acme Studio", "externalId": "user_8412"}'ts
import { Flung } from '@flung.dev/sdk'
const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })const result = await flung.profiles.update({ id: 'prof_aaaaaaaaaaaaaaaaaaaaaaaa', name: 'Acme Studio', externalId: 'user_8412',})js
const response = await fetch('https://api.flung.dev/v1/profiles/prof_aaaaaaaaaaaaaaaaaaaaaaaa', { method: 'PATCH', headers: { 'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ name: 'Acme Studio', externalId: 'user_8412', }),})if (!response.ok) throw new Error((await response.json()).error.message)const result = await response.json()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"}Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes |
Request body
The body has the type an object, with the fields below.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | A 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. |
externalId | string | null | no | A new external id, or null to clear it. at least 1 character; at most 255 characters. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The profile. | Profile |
| 401 | Missing, unknown, revoked or expired API key. | Error |
| 404 | No such profile in this workspace. | Error |
| 409 | Another profile already has this external id. | Error |
| 422 | The request failed validation. | Error |
| 429 | Too many requests for this credential; wait for retry-after seconds. | Error |
Response body
A 200 answer has the type Profile.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
name | string | yes | |
externalId | string | null | yes | |
createdAt | string | yes | |
updatedAt | string | yes |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint |
| Schemas | Every request and response type |
| Errors | Every error code and what to do about it |