Gamma API
OrganizationsOrganizations

Leave an organization

POST
/api/organizations/{slug}/leave

Ends the caller's own membership; answers it as it was. Answered by the auth plugin, whose refusals are { code, message } rather than { error }.

Who may call it: Any member of the organization. API keys: no.

Authorization

session
cookiegamma.session_token<token>

The session cookie a sign-in sets. Over HTTPS its name carries the __Secure- prefix. Browsers send it on their own; other clients keep it from the sign-in response.

Path Parameters

slug*string

The organization's slug, as in its URL.

Response Body

OK.

application/json
  1. response

A person's membership of an organization.

id*string

The membership's id.

organizationId*string
userId*string
role*string

owner, admin, member, or guest (on projects only).

createdAt*string

When they joined.

Formatdate-time
user*
Example Request
curl -X POST 'http://localhost:3000/api/organizations/string/leave'
Example Response
{  "id": "string",  "organizationId": "string",  "userId": "string",  "role": "string",  "createdAt": "2019-08-24T14:15:22Z",  "user": {    "id": "string",    "name": "string",    "email": "string",    "image": "string"  }}