Skip to Content
API ReferenceOrganizations

Organizations

List my organizations

GET /a/v1/organizations/me

A page of the organizations the signed-in user is a member of, the default first and then the newest, with their role and membership status and the total in pagination. current marks the organization of this session; search keeps the organizations whose name holds it. Without limit, a page holds 100 (the most).

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 100. Between 1 and 100.
searchquerystringNoPart of the organization’s name. 1 to 100 characters.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 429, 500, 503


Update the current organization

PATCH /a/v1/organizations/me

Changes the name, contact email, website, address or seller code. Changing contactEmail or address also needs the organization.update_contact capability. The seller code starts every document number and can be changed only until the first document is numbered (409 after that). The response carries the organization summary, the seller code and whether it is locked, plus each contact field that was changed.

Who can call it: Signed-in user only: do this in the Yona app.

Request body

FieldTypeRequiredDescription
namestringNo1 to 255 characters.
contactEmailstring (email)NoAt most 254 characters.
websitestring (uri)NoAt most 255 characters.
addressobject (Address)No
sellerCodestringNoThe seller code every document number carries: 3 to 5 letters, upper-cased, not ending in CN or DN. It can be changed until the first document is numbered. 3 to 5 characters.

address

FieldTypeRequiredDescription
line1stringYesFirst line of the street address. 1 to 200 characters.
line2stringNoSecond line of the street address. 1 to 200 characters.
citystringYesCity or town. 1 to 100 characters.
statestringYesState or region. 1 to 100 characters.
lgastringNoLocal government area. 1 to 100 characters.
postalCodestringNoPostal code. 1 to 20 characters.
countrystringYesCountry, as an ISO 3166-1 alpha-2 code. 2 to 2 characters.

Example request

bash
curl -X PATCH https://gp.useyona.com/a/v1/organizations/me \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Trading",
    "contactEmail": "accounts@acme.ng",
    "website": "https://acme.ng",
    "sellerCode": "EKA"
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


Get the organization readiness

GET /a/v1/organizations/me/readiness

The onboarding checklist, the live-access status and the next step. Available to users and API keys.

Who can call it: API key or signed-in user.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/readiness \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Errors: 401, 403, 404, 429, 500, 503


Get the organization profile

GET /a/v1/organizations/{orgId}

The profile of the organization the token belongs to. orgId must be that organization (404 otherwise). Available to users and API keys.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Errors: 400, 401, 403, 404, 429, 500, 503


Update an organization by id

PATCH /a/v1/organizations/{orgId}

The same update as PATCH /a/v1/organizations/me; orgId must be the organization of the session (404 otherwise). Changes the name, contact email, website, address or seller code. Changing contactEmail or address also needs the organization.update_contact capability. The seller code starts every document number and can be changed only until the first document is numbered (409 after that). The response carries the organization summary, the seller code and whether it is locked, plus each contact field that was changed.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Request body

FieldTypeRequiredDescription
namestringNo1 to 255 characters.
contactEmailstring (email)NoAt most 254 characters.
websitestring (uri)NoAt most 255 characters.
addressobject (Address)No
sellerCodestringNoThe seller code every document number carries: 3 to 5 letters, upper-cased, not ending in CN or DN. It can be changed until the first document is numbered. 3 to 5 characters.

address

FieldTypeRequiredDescription
line1stringYesFirst line of the street address. 1 to 200 characters.
line2stringNoSecond line of the street address. 1 to 200 characters.
citystringYesCity or town. 1 to 100 characters.
statestringYesState or region. 1 to 100 characters.
lgastringNoLocal government area. 1 to 100 characters.
postalCodestringNoPostal code. 1 to 20 characters.
countrystringYesCountry, as an ISO 3166-1 alpha-2 code. 2 to 2 characters.

Example request

bash
curl -X PATCH https://gp.useyona.com/a/v1/organizations/me \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Trading",
    "contactEmail": "accounts@acme.ng",
    "website": "https://acme.ng",
    "sellerCode": "EKA"
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


List the secondary organizations of the current organization

GET /a/v1/organizations/me/children

A page of the token’s organization’s children, newest first, with the total in pagination. search keeps the children whose name holds it; ids keeps only the children named (at most 100), for a caller that holds their ids and needs their names. Without limit, a page holds 100 (the most). Membership of the parent confers nothing in a child: enter one with POST /a/v1/organizations/switch only with an active membership there. Available to users and to API keys, in sandbox and live. A key needs organization.children.read, which no key preset includes: a member who holds it adds it by name when creating the key or by replacing its permissions. Answers 404 RES001 while secondary organizations are switched off in the environment.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 100. Between 1 and 100.
searchquerystringNoPart of the organization’s name. 1 to 100 characters.
idsquerystringNoOnly these sub-organizations: their ids, comma-separated, at most 100. An id that is not one of the organization’s sub-organizations is left out of the answer.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/children \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Create an organization — a secondary of the current one, or the caller’s first

POST /a/v1/organizations

With an organization in the token: a SECONDARY (child) of it, the caller its OWNER — the token’s organization must be a primary that has completed onboarding, the caller must hold organization.children.create there (re-read from the database, never from the token), and the parent must have fewer than the environment’s limit of children. The child takes the parent’s country. With NO organization in the token: the caller’s first, PRIMARY organization — allowed only while the person holds no active membership. An API key can create a secondary too: a LIVE key that was given organization.children.create by name (no key preset includes it; an Owner or Admin adds it when creating the key or by replacing its permissions). The new organization is then recorded under the parent’s longest-standing Owner, who becomes its Owner. A sandbox key is refused: an organization exists for both modes. An API key’s call is safe to repeat: send an Idempotency-Key header, or give the organization your own externalReference, and a repeated call returns the organization already created with replayed: true instead of making a second one. A key that also holds organization.children.onboard creates a sub-organization it may then onboard (onboardingManaged: true); that needs the parent to have accepted the current managed onboarding terms. A signed-in Owner or Admin in live mode gets the same with groupOnboarding: true, and may then send externalReference and an Idempotency-Key as a key does. Without either, a name is unique under its parent, so a repeated request answers 409 RES002 and the organization is found with GET /a/v1/organizations/me/children. Neither branch issues a token or switches the session: call POST /a/v1/organizations/switch next. Answers 404 RES001 while secondary organizations are switched off in the environment.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNoOptional, read for an API key and for a signed-in person who sends groupOnboarding: true: 8–128 characters of A–Z, a–z, 0–9, _ or -. The same key with the same body returns the organization already created; with another body it is 409 BIZ107. Remembered for 7 days.

Request body

FieldTypeRequiredDescription
businessNamestringYesThe new organization’s name. 2 to 255 characters.
emailstring (email)YesBecomes the organization’s contact email (lower-cased). At most 254 characters.
phoneNumberstringNoE.164; spaces, dashes, dots and brackets are removed before validation. At most 16 characters.
websitestring (uri)NoThe new organization’s website: an https URL of at most 255 characters. At most 255 characters.
countrystringNoISO-3166-1 alpha-2; only for a first organization (defaults to NG). Refused when the token has an organization: a child takes its parent’s country. 2 to 2 characters.
intentstringNoWhich rail the organization comes for: core (default), access, or both. One of core | access | both.
externalReferencestringNoYour own id for the new sub-organization, when an API key creates it: letters, digits, dot, colon, underscore or hyphen. Sending the same one again returns the organization already created. 1 to 64 characters.
groupOnboardingbooleanNoSigned-in people only: set to true to add the sub-organization through managed onboarding, so your organization can send its Tax ID and contact details and create its setup link. Needs live mode and your accepted managed onboarding terms. An API key leaves this out.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "businessName": "Acme Retail Ltd",
    "email": "ada@example.com",
    "phoneNumber": "+2348012345678",
    "website": "https://acme.ng",
    "country": "NG",
    "intent": "access",
    "externalReference": "crm-0042",
    "groupOnboarding": true
  }'

Responses

The new organization (Org): type is secondary with parentOrganizationId for a child, primary with null for a first organization; status is pending_verification until its own onboarding completes.

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 429, 500, 503


List the sub-organizations with how ready each is to issue live

GET /a/v1/organizations/me/children/readiness

The same page as GET /a/v1/organizations/me/children — newest first, the total in pagination, search and ids as there — with each sub-organization’s onboarding checklist, live status and next step, so a parent sees which of its businesses still have something to do. It carries what the sub-organization’s own readiness read carries, without the reviewer’s message after a rejection. Whether a sub-organization is connected to the tax authority is read from GET /i/v1/tax-connection/children with the same ids. Available to users and to API keys holding organization.children.read, in sandbox and live. Answers 404 RES001 while secondary organizations are switched off in the environment.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 100. Between 1 and 100.
searchquerystringNoPart of the organization’s name. 1 to 100 characters.
idsquerystringNoOnly these sub-organizations: their ids, comma-separated, at most 100. An id that is not one of the organization’s sub-organizations is left out of the answer.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/children/readiness \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Set the contact details of a sub-organization

PUT /a/v1/organizations/me/children/{childId}/onboarding/contact

Sets the contact phone, and optionally the contact email and address, of a sub-organization this organization manages. For a live API key holding organization.children.onboard, or a signed-in Owner or Admin in live mode. Safe to repeat: the same values change nothing. A changed phone number must be verified again by the business owner. One phone number serves one managed sub-organization.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
childIdpathstring (uuid)YesThe sub-organization, one this organization added through managed onboarding and still manages.

Request body

FieldTypeRequiredDescription
phoneNumberstringYesBusiness phone number, E.164. At most 16 characters.
contactEmailstring (email)NoContact email of the business. Left as it is when not sent. At most 254 characters.
addressobject (Address)NoAddress of the business. Left as it is when not sent.

address

FieldTypeRequiredDescription
line1stringYesFirst line of the street address. 1 to 200 characters.
line2stringNoSecond line of the street address. 1 to 200 characters.
citystringYesCity or town. 1 to 100 characters.
statestringYesState or region. 1 to 100 characters.
lgastringNoLocal government area. 1 to 100 characters.
postalCodestringNoPostal code. 1 to 20 characters.
countrystringYesCountry, as an ISO 3166-1 alpha-2 code. 2 to 2 characters.

Example request

bash
curl -X PUT https://gp.useyona.com/a/v1/organizations/me/children/0199a1b2-7c3d-7e4f-8a9b-3c5d7e9f1a2c/onboarding/contact \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "+2348012345678",
    "contactEmail": "accounts@acme.ng"
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


Submit a sub-organization for review

POST /a/v1/organizations/me/children/{childId}/onboarding/submit

Asks Yona to review a sub-organization this organization manages, accepting Yona’s terms for it under the managed onboarding terms. For a live API key holding organization.children.onboard, or a signed-in Owner or Admin in live mode. It needs the Tax ID verified and the contact details set. If the business owner has already verified the phone, the sub-organization goes to review now. If not, the request is recorded and it goes to review by itself when the owner verifies the phone. Safe to repeat: a sub-organization already submitted answers where it stands, with replayed set.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
childIdpathstring (uuid)YesThe sub-organization, one this organization added through managed onboarding and still manages.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/children/0199a1b2-7c3d-7e4f-8a9b-3c5d7e9f1a2c/onboarding/submit \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Verify the Tax ID of a sub-organization

POST /a/v1/organizations/me/children/{childId}/onboarding/tax-id

Checks the Tax ID of a sub-organization this organization manages with the tax authority, and that the business name matches the name registered to it. For a live API key holding organization.children.onboard, or a signed-in Owner or Admin in live mode. Safe to repeat: a Tax ID already verified for the sub-organization answers the stored result with replayed set and no new check. Each check counts toward a daily limit per sub-organization and one across all the sub-organizations.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
childIdpathstring (uuid)YesThe sub-organization, one this organization added through managed onboarding and still manages.

Request body

FieldTypeRequiredDescription
businessNamestringYesBusiness name — must match the name registered to the TIN. 1 to 255 characters.
taxNostringYesTax identification number: the 13-digit Tax ID (1234567890123), a 10 or 11 digit TIN (1234567890), or the older 8-4 form (12345678-0001).
registrationNumberstringNoThe business registration number at the registry, when known. Send it with registrationType. 1 to 32 characters.
registrationTypestringNoThe kind of entity the registration number names. Send it with registrationNumber. One of BUSINESS_NAME | COMPANY | INCORPORATED_TRUSTEE | LIMITED_PARTNERSHIP | LIMITED_LIABILITY_PARTNERSHIP.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/children/0199a1b2-7c3d-7e4f-8a9b-3c5d7e9f1a2c/onboarding/tax-id \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "businessName": "Acme Trading Limited",
    "taxNo": "1234567890123",
    "registrationNumber": "1234567",
    "registrationType": "COMPANY"
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 422, 429, 500, 503


POST /a/v1/organizations/me/children/{childId}/setup-link

Creates the link you send to the business owner of a sub-organization this organization manages. On it the owner verifies the contact phone with a code sent by SMS and, once Yona approves the business, gives consent to connect it to the tax authority. For a live API key holding organization.children.onboard, or a signed-in Owner or Admin in live mode. The sub-organization needs a contact phone first. After Yona approves a sub-organization you can still create a new link for it, for an owner who lost the first one, as long as its contact phone is the one verified on a setup link. The link is shown once, in this answer: Yona keeps only a hash of it. A sub-organization has one working link, so a new link stops the previous one. Safe to repeat with an Idempotency-Key header.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
childIdpathstring (uuid)YesThe sub-organization, one this organization added through managed onboarding and still manages.
Idempotency-KeyheaderstringNoOptional: 8–128 characters of A–Z, a–z, 0–9, _ or -. The same key for the same sub-organization and the same life returns the link already created, without its URL and with replayed: true, and creates no second link. With another sub-organization or life it is 409 BIZ107. Remembered for 7 days.

Request body

FieldTypeRequiredDescription
expiresInDaysnumberNoHow many days the link works for. 14 when not sent, 30 at most. Between 1 and 30.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/children/0199a1b2-7c3d-7e4f-8a9b-3c5d7e9f1a2c/setup-link \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "expiresInDays": 14
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


DELETE /a/v1/organizations/me/children/{childId}/setup-link

Stops the working setup link of a sub-organization, at once. It works for the same sub-organizations a link can be created for. For a live API key holding organization.children.onboard, or a signed-in Owner or Admin in live mode. Safe to repeat: with no working link it answers revoked false.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
childIdpathstring (uuid)YesThe sub-organization, one this organization added through managed onboarding and still manages.

Example request

bash
curl -X DELETE https://gp.useyona.com/a/v1/organizations/me/children/0199a1b2-7c3d-7e4f-8a9b-3c5d7e9f1a2c/setup-link \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Read the managed onboarding terms

GET /a/v1/organizations/me/group-terms

The current version of the managed onboarding terms, and whether the organization has accepted it. A parent organization accepts the managed onboarding terms once, on behalf of its sub-organizations, before its API keys can onboard them.

Who can call it: API key or signed-in user.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/group-terms \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

Errors: 401, 403, 404, 409, 429, 500, 503


Accept the managed onboarding terms

POST /a/v1/organizations/me/group-terms

Accepts the managed onboarding terms on behalf of the organization’s sub-organizations, as the signed-in Owner or Admin. It needs a second factor proved in the last few minutes. Send the version you read; an older version is refused. Accepting the same version again changes nothing. Recorded in the organization’s audit trail.

Who can call it: Signed-in user only: do this in the Yona app.

Request body

FieldTypeRequiredDescription
versionstringYesThe version of the managed onboarding terms being accepted: the one the read returns as current. 1 to 64 characters.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/group-terms \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "version": "2026-11"
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


List members

GET /a/v1/organizations/{orgId}/users

A page of the organization’s members, filtered by the query.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 20. Between 1 and 100.
statusquerystringNoOne of active | suspended.
rolequerystringNoA system role key, or one of the organization’s custom role keys (custom_…).
searchquerystringNoName or email prefix. 1 to 100 characters.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/users \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 429, 500, 503


Get a member

GET /a/v1/organizations/{orgId}/users/{userId}

One member of the organization, by user id: name, email, role, membership status, join date and whether two-factor is on. A signed-in member holding member.read may call it. A user who is not a member, or whose membership was removed, answers 404 RES001, as does an orgId that is not the token’s organization.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
userIdpathstring (uuid)Yes

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/users/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 429, 500, 503


Remove a member

DELETE /a/v1/organizations/{orgId}/users/{userId}

Removes the member from the organization: the membership becomes removed, the member’s sessions in the organization are revoked and any chat channel they linked through it is unlinked. Removing a member from a primary organization removes them from its sub-organizations too. Needs member.remove. The caller cannot remove themselves (leaving is its own route), a member ranked at or above them, or a member holding a capability they lack (403 BIZ003); an unknown or already removed member answers 404 RES001.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
userIdpathstring (uuid)Yes

Example request

bash
curl -X DELETE https://gp.useyona.com/a/v1/organizations/me/users/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Leave the organization

POST /a/v1/organizations/{orgId}/leave

Ends the caller’s own membership in the organization.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/leave \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Transfer ownership

POST /a/v1/organizations/{orgId}/ownership-transfer

Makes another active member the owner. The caller confirms with their password (and, when two-factor is on, a current authenticator code or a recent step-up) and becomes an admin unless they choose to stay an owner.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Request body

FieldTypeRequiredDescription
toUserIdstring (uuid)YesAn active member with a verified email, not the caller.
passwordstring (password)Yes1 to 128 characters.
codestringNoRequired when the caller has TOTP: a TOTP or recovery code.
retainOwnershipbooleanNoKeep OWNER as well (default false: the caller becomes ADMIN).

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/ownership-transfer \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "toUserId": "9f8e7d6c-5b4a-3210-fedc-ba9876543210",
    "password": "your-password",
    "code": "104829"
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


Change a member’s role

PATCH /a/v1/organizations/{orgId}/users/{userId}/role

Assigns another role to the member, a fixed role or one of the organization’s custom roles. When the caller has two-factor on, it needs a step-up in the last 5 minutes (403 AUTH033 otherwise). Access tokens the member already holds are refused until they refresh, so the new role applies at once.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
userIdpathstring (uuid)Yes

Request body

FieldTypeRequiredDescription
roleIdstring (uuid)YesA system role id (fixed per role key); OWNER is refused by the service.

Example request

bash
curl -X PATCH https://gp.useyona.com/a/v1/organizations/me/users/d8b2e4f6-9a3c-5b7d-0e1f-2a3b4c5d6e7f/role \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "roleId": "9f8e7d6c-5b4a-3210-fedc-ba9876543210"
  }'

Responses

Errors: 400, 401, 403, 404, 413, 415, 429, 500, 503


Suspend or restore a member

PATCH /a/v1/organizations/{orgId}/users/{userId}/status

Sets the membership status in this organization: suspended needs member.suspend, active needs member.restore.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
userIdpathstring (uuid)Yes

Request body

FieldTypeRequiredDescription
statusstringYesOne of active | suspended.
reasonstringNo1 to 500 characters.

Example request

bash
curl -X PATCH https://gp.useyona.com/a/v1/organizations/me/users/9f8e7d6c-5b4a-3210-fedc-ba9876543210/status \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "suspended"
  }'

Responses

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


List roles

GET /a/v1/organizations/{orgId}/roles

The six fixed roles, each with what it confers, then the organization’s own custom roles by label. Each custom role carries usage: how many members hold it and how many pending invitations offer it (null for a fixed role). Another organization’s custom roles are never listed.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/roles \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Role[]: fixed roles first (isSystem: true), then custom roles.

Errors: 400, 401, 403, 404, 429, 500, 503


Create a custom role

POST /a/v1/organizations/{orgId}/roles

Defines a role of the organization from the capabilities a custom role may hold. Only the owner may. When the owner has two-factor on, it needs a step-up in the last 5 minutes. The key (custom_…) is generated and never changes; the rank is always 1. Assign it to a member with the change-role route, or offer it in an invitation. An organization has at most 50 custom roles.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Request body

FieldTypeRequiredDescription
labelstringYesShown wherever the role is named. Trimmed, with every run of inner spaces collapsed to one; unique in the organization (case-insensitive) and never a fixed role’s label. 1 to 100 characters.
descriptionstringNoWhat the role is for. 0 to 500 characters.
capabilitiesarray of stringYesWhat the role confers: one or more capabilities a custom role may hold (no owner-only one), each within the caller’s own. Each item is one of organization.read | organization.update_profile | organization.update_contact | organization.verify_tax_id | organization.verify_phone | organization.complete_onboarding | organization.request_live_access | live_mode.use | media.logo.upload | media.logo.remove | organization.children.read | organization.children.create | organization.children.onboard | organization.children.accept_terms | member.read | member.invite | member.read_invitations | member.resend_invite | member.withdraw_invite | member.suspend | member.restore | member.remove | member.change_role | role.read | api_key.read | api_key.create | api_key.rename | api_key.update_capabilities | api_key.rotate | api_key.revoke | billing.account.read | billing.usage.read | billing.ledger.read | billing.statement.read | billing.payment.read | billing.subscription.read | billing.low_balance.configure | billing.credits.purchase | billing.subscription.subscribe | billing.subscription.cancel | billing.subscription.resume | billing.subscription.renew | billing.subscription.change_plan | billing.pool.read | billing.pool.configure | billing.credits.transfer | billing.metered.read | billing.metered.manage | webhook.endpoint.read | webhook.endpoint.create | webhook.endpoint.update | webhook.endpoint.delete | webhook.endpoint.rotate_secret | webhook.endpoint.test | webhook.delivery.read | webhook.delivery.redeliver | audit.read | collection.account.read | collection.account.create | collection.account.deactivate | collection.settlement_account.read | collection.settlement_account.manage | collection.payment.read | collection.payment.refund | collection.exception.read | collection.exception.resolve | assistant.use | bank_account.read | bank_account.settlement.opt_in | counterparty.read | counterparty.manage | transfer.read | transfer.send | registry.read | registry.lookup | access.read | access.apply | access.credentials.manage | access.grants.manage | access.webhooks.manage | access.submissions.retransmit | access.conformance.run | access.children.manage | invoice.read | invoice.stats.read | invoice.create | invoice.update_draft | invoice.delete_draft | invoice.finalise | invoice.validate | invoice.submit | invoice.retry | invoice.query_status | invoice.cancel | invoice.record_payment | invoice.send_to_buyer | invoice.download_pdf | invoice.download_authority_copy | invoice.reopen | invoice.share | invoice.inbound.read | invoice.inbound.retrieve | reference.read | tax_id.lookup | buyer.read | buyer.create | buyer.update | buyer.delete | buyer.verify_tax_id | item.read | item.create | item.update | item.archive | seller.read | tax_connection.read | tax_connection.connect | tax_connection.disconnect | tax_connection.install_key.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/roles \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Bookkeeper",
    "capabilities": [
      "organization.read"
    ]
  }'

Responses

The new Role (isSystem: false).

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


Get a role

GET /a/v1/organizations/{orgId}/roles/{roleId}

One fixed role, or one of the organization’s custom roles, with what it confers. A custom role carries usage: how many members hold it and how many pending invitations offer it (null for a fixed role).

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
roleIdpathstring (uuid)Yes

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/roles/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Role.

Errors: 400, 401, 403, 404, 429, 500, 503


Edit a custom role

PATCH /a/v1/organizations/{orgId}/roles/{roleId}

Changes a custom role’s label, description or capabilities (a new list replaces the old). Only the owner may. When the owner has two-factor on, it needs a step-up in the last 5 minutes. When the capabilities change, every member holding the role must refresh: their current access token is refused with AUTH011, and the refreshed one carries the new list. A fixed role never changes.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
roleIdpathstring (uuid)Yes

Request body

FieldTypeRequiredDescription
labelstringNoTrimmed, with every run of inner spaces collapsed to one; unique in the organization (case-insensitive) and never a fixed role’s label. 1 to 100 characters.
descriptionstringNoWhat the role is for; an empty string clears it. 0 to 500 characters.
capabilitiesarray of stringNoThe new list — it replaces the role’s, and its holders’ next token carries it. Each item is one of organization.read | organization.update_profile | organization.update_contact | organization.verify_tax_id | organization.verify_phone | organization.complete_onboarding | organization.request_live_access | live_mode.use | media.logo.upload | media.logo.remove | organization.children.read | organization.children.create | organization.children.onboard | organization.children.accept_terms | member.read | member.invite | member.read_invitations | member.resend_invite | member.withdraw_invite | member.suspend | member.restore | member.remove | member.change_role | role.read | api_key.read | api_key.create | api_key.rename | api_key.update_capabilities | api_key.rotate | api_key.revoke | billing.account.read | billing.usage.read | billing.ledger.read | billing.statement.read | billing.payment.read | billing.subscription.read | billing.low_balance.configure | billing.credits.purchase | billing.subscription.subscribe | billing.subscription.cancel | billing.subscription.resume | billing.subscription.renew | billing.subscription.change_plan | billing.pool.read | billing.pool.configure | billing.credits.transfer | billing.metered.read | billing.metered.manage | webhook.endpoint.read | webhook.endpoint.create | webhook.endpoint.update | webhook.endpoint.delete | webhook.endpoint.rotate_secret | webhook.endpoint.test | webhook.delivery.read | webhook.delivery.redeliver | audit.read | collection.account.read | collection.account.create | collection.account.deactivate | collection.settlement_account.read | collection.settlement_account.manage | collection.payment.read | collection.payment.refund | collection.exception.read | collection.exception.resolve | assistant.use | bank_account.read | bank_account.settlement.opt_in | counterparty.read | counterparty.manage | transfer.read | transfer.send | registry.read | registry.lookup | access.read | access.apply | access.credentials.manage | access.grants.manage | access.webhooks.manage | access.submissions.retransmit | access.conformance.run | access.children.manage | invoice.read | invoice.stats.read | invoice.create | invoice.update_draft | invoice.delete_draft | invoice.finalise | invoice.validate | invoice.submit | invoice.retry | invoice.query_status | invoice.cancel | invoice.record_payment | invoice.send_to_buyer | invoice.download_pdf | invoice.download_authority_copy | invoice.reopen | invoice.share | invoice.inbound.read | invoice.inbound.retrieve | reference.read | tax_id.lookup | buyer.read | buyer.create | buyer.update | buyer.delete | buyer.verify_tax_id | item.read | item.create | item.update | item.archive | seller.read | tax_connection.read | tax_connection.connect | tax_connection.disconnect | tax_connection.install_key.

Example request

bash
curl -X PATCH https://gp.useyona.com/a/v1/organizations/me/roles/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Bookkeeper"
  }'

Responses

The edited Role.

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500, 503


Delete a custom role

DELETE /a/v1/organizations/{orgId}/roles/{roleId}

Deletes a custom role that no member holds and no pending invitation offers. Only the owner may. When the owner has two-factor on, it needs a step-up in the last 5 minutes. Members are never moved to another role by a delete: move them first, and withdraw the pending invitations that offer it. Past memberships and closed invitations that name the role keep naming it. A deleted role is gone from every list and read, and its label is free again.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
roleIdpathstring (uuid)Yes

Example request

bash
curl -X DELETE https://gp.useyona.com/a/v1/organizations/me/roles/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

{deleted: true}.

Errors: 400, 401, 403, 404, 409, 429, 500, 503


List available capabilities

GET /a/v1/organizations/{orgId}/roles/permissions/available

Every capability a member can hold, with its label and properties — customRoleGrantable says which a custom role may hold — and the subset an API key may hold.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/roles/permissions/available \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 429, 500, 503


List invitations

GET /a/v1/organizations/{orgId}/invitations

A page of the organization’s invitations (pending by default). No invitation codes are returned.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
statusquerystringNoOne of pending | accepted | withdrawn | expired.
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 20. Between 1 and 100.

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/invitations \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 429, 500, 503


Invite someone to the organization

POST /a/v1/organizations/{orgId}/invitations

Emails an invitation code to the invitee. The code is never returned by the API; it exists only in the email.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.

Request body

FieldTypeRequiredDescription
emailstring (email)YesAt most 254 characters.
fullNamestringYes2 to 255 characters.
roleIdstring (uuid)NoA system role other than OWNER, ranked ≤ the inviter; default MEMBER.
messagestringNoIncluded in the invitation email. 1 to 500 characters.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/invitations \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@acme.ng",
    "fullName": "Ada Obi"
  }'

Responses

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 429, 500, 503


Get an invitation

GET /a/v1/organizations/{orgId}/invitations/{id}

One invitation of the organization, without its code.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
idpathstring (uuid)Yes

Example request

bash
curl https://gp.useyona.com/a/v1/organizations/me/invitations/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 429, 500, 503


Withdraw a pending invitation

DELETE /a/v1/organizations/{orgId}/invitations/{id}

Withdraws a pending invitation of the organization: its code stops working and the invitee can no longer accept it. Needs member.withdraw_invite. An invitation already accepted, withdrawn or expired answers 409 BIZ004; one that is not the organization’s answers 404 RES001.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
idpathstring (uuid)Yes

Example request

bash
curl -X DELETE https://gp.useyona.com/a/v1/organizations/me/invitations/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Resend an invitation

POST /a/v1/organizations/{orgId}/invitations/{id}/resend

Emails the invitee a new code; the previous code stops working.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
orgIdpathstringYesOrganization id — must equal the token’s organization — or me.
idpathstring (uuid)Yes

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/organizations/me/invitations/9f8e7d6c-5b4a-3210-fedc-ba9876543210/resend \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Accept an invitation

POST /a/v1/accept-invitation

The signed-in user, whose verified email is the invitee’s, joins the organization. No tokens are returned: to work in the new organization, switch to it with POST /a/v1/organizations/switch.

Who can call it: Signed-in user only: do this in the Yona app.

Request body

FieldTypeRequiredDescription
invitationCodestringYes8 Crockford base32 characters; case, spaces and hyphens are ignored. 8 to 8 characters.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/accept-invitation \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "invitationCode": "K7M2Q9XA"
  }'

Responses

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 429, 500, 503


Preview an invitation

POST /a/v1/verify-invitation

Public. Given the invitation code and the invitee’s email, returns what the invitee may see before accepting. Any mismatch answers the same 404.

Who can call it: Anyone: no authentication.

Request body

FieldTypeRequiredDescription
invitationCodestringYes8 Crockford base32 characters; case, spaces and hyphens are ignored. 8 to 8 characters.
emailstring (email)YesAt most 254 characters.

Example request

bash
curl -X POST https://gp.useyona.com/a/v1/verify-invitation \
  -H "Content-Type: application/json" \
  -d '{
    "invitationCode": "K7M2Q9XA",
    "email": "ada@example.com"
  }'

Responses

Errors: 400, 404, 413, 415, 429, 500, 503