Skip to main content
POST
Change a project's customer
Sets or clears the customer a project is for: change is {"operation": "set", "customerId": "…"} or {"operation": "clear"}. The project is decided at its home first, exactly as the lifecycle commands decide it: a project you cannot read (projects:read at its home) answers 404, and one you can read but not change (projects:manage there) answers 403. Then a customer that does not exist answers 404 and an archived one 409 invalid_state. The change is audited as the Console audits it, with the credential as actor. The project’s home, which decides who can read it, does not move. Setting the customer the project already has, or clearing an empty one, returns the unchanged project and writes nothing. Success is 200 with the Project. Your scopes must include projects:read as well as projects:manage, because the success returns the project; otherwise 403 naming projects:read, and nothing changes. Send an Idempotency-Key to make a retry safe: a same-key retry within 24 hours returns the recorded result only while your scopes still include projects:read and you may still read and change the project at its home; otherwise 409 idempotency_result_unavailable.

Authorizations

Authorization
string
header
required

An External App: the JWT it obtains from POST /oauth/token with OAuth2 client_credentials. Pass as Authorization: Bearer <jwt>. An app's static companion key also authenticates as the app, but is deprecated and is not protected by Idempotency-Key.

Headers

Idempotency-Key
string

Optional logical intent key. A same-key retry within 24 hours returns the recorded result without writing again.

Required string length: 1 - 255

Path Parameters

projectId
string
required

The project ID, as GET /api/v2/projects/get returns it.

Minimum string length: 1

Body

application/json

Set or clear the customer a project is for. The project's home does not move. Unknown fields are refused.

change
object
required

Set the project's customer, or clear it.

Response

Success

data
object
required
meta
object
required