Skip to content
Connect an agent

Connections

Register an app

Registers an app that signs in with Plotwork.

POST/user/apps/registered

TL;DR

QuestionAnswer
What does it do?Register an app.
What does it take?A JSON body of type NewAppBody.
What does it return?Status 201 with a body of type AppWithSecret.
What can go wrong?400 the body is not valid; 401 not signed in; 403 the request came from an origin that may not make changes; 409 you hold the most apps allowed (apps.limit_reached); 422 a redirect address or the homepage breaks the rules (apps.invalid); 429 too many requests. Every failure uses the one error envelope.

What it does

Registers an app that signs in with Plotwork. A confidential app gets a client secret, shown in this answer only. Redirect addresses are https, or http on a loopback host, matched exactly.

Request body

The body has the type NewAppBody.

FieldTypeRequiredDescription
namestringyesat least 3 characters; at most 60 characters.
homepagestring | nullnoAn https address, shown as a claim. at most 2048 characters.
clientType"confidential" | "public"yes
redirectUrisstring[]yesOne to ten addresses a code may be sent to, matched exactly: https, or http on localhost, 127.0.0.1 or [::1] with any port.

Responses

StatusMeaningBody
201Registered, with the secret shown once.AppWithSecret
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403The request came from an origin that may not make changes.ErrorResponse
409You hold the most apps allowed (apps.limit_reached).ErrorResponse
422A redirect address or the homepage breaks the rules (apps.invalid).ErrorResponse
429Too many requests.ErrorResponse

Response body

A 201 answer has the type AppWithSecret.

FieldTypeRequiredDescription
idstringyesThe app's id, which is its OAuth client_id.
namestringyesShown to people as a claim on the consent page.
homepagestring | nullyes
clientType"confidential" | "public"yesconfidential holds a client secret on its server; public (a page or a tool with no server) holds none.
redirectUrisstring[]yes
membersOnlybooleanyesFor an organisation's app: only its members may connect it, to the organisation.
hasSecretbooleanyes
createdAtintegeryesMilliseconds since the epoch.
updatedAtintegeryesMilliseconds since the epoch.
clientSecretstring | nullyesThe client secret (pws_...), shown once, or null for a public app. Store it on your server.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools