Create an organization
POST
/api/v1/orgs
const url = 'https://api.pkgplease.com/api/v1/orgs';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","slug":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pkgplease.com/api/v1/orgs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "slug": "example" }'Creates the org, an owner user, and an identity row; issues a developer token.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
slug
required
string
Examplegenerated
{ "name": "example", "slug": "example"}Responses
Section titled “Responses”Org created
Media typeapplication/json
object
org
object
id
string
name
string
slug
string
token
string
Examplegenerated
{ "org": { "id": "example", "name": "example", "slug": "example" }, "token": "example"}Identity already belongs to an org
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}