Skip to content

Organizations ​

An organization is the tenant that owns projects, devices, members, and tokens. Organization endpoints read its profile and plan status, and let an Owner update the profile.

MethodEndpointDescription
GET/api/v2/organizations/List organizations of the signed-in user
GET/api/v2/organizations/{slug}/Retrieve an organization
GET/api/v2/organizations/{slug}/membership/Retrieve membership status
PATCH/api/v2/organizations/{slug}/Update an organization

Creating, deleting, and leaving an organization happen in the console and need a signed-in user.

The organization object ​

json
{
  "name": "YenGear Lab",
  "slug": "yengear",
  "logo": "https://dl.yengear.com/media/org/logo.png",
  "allow_join": false,
  "allow_search": false,
  "is_active": true,
  "access_config": null
}
FieldTypeDescription
namestringDisplay name
slugstringOrganization identifier. Set at creation and read-only afterwards.
logostring | nullLogo URL
allow_joinbooleanWhether users can request to join
allow_searchbooleanWhether the organization appears in search
is_activebooleanAPI tokens of an inactive organization are rejected
access_configobject | nullRole and project scope of the signed-in user: role, role_display, all_projects, projects. null for API tokens.

List organizations ​

http
GET /api/v2/organizations/

Returns every organization the signed-in user belongs to.

Authentication ​

User JWT only. API tokens receive 403.

Example request ​

bash
curl 'https://dl.yengear.com/api/v2/organizations/' \
  -H 'Authorization: Bearer YOUR_USER_JWT'

Example response ​

json
{
  "success": true,
  "data": [
    { "name": "YenGear Lab", "slug": "yengear", "logo": null, "allow_join": false, "allow_search": false, "is_active": true, "access_config": { "role": "owner", "role_display": "Owner", "all_projects": true, "projects": [] } }
  ],
  "error": null
}

Responses ​

Retrieve an organization ​

http
GET /api/v2/organizations/{slug}/

Returns one organization. With an API token, the response is always the token's own organization.

Authentication ​

Bearer token. Minimum role: Read-only.

Path parameters ​

NameTypeRequiredDescription
slugstringYesOrganization slug

Example request ​

bash
curl 'https://dl.yengear.com/api/v2/organizations/yengear/' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'

Example response ​

json
{
  "success": true,
  "data": {
    "name": "YenGear Lab",
    "slug": "yengear",
    "logo": null,
    "allow_join": false,
    "allow_search": false,
    "is_active": true,
    "access_config": null
  },
  "error": null
}

Responses ​

Retrieve membership status ​

http
GET /api/v2/organizations/{slug}/membership/

Returns the organization's plan status. Read-only and Operator callers receive a summary; Manager and Owner callers receive the full status, including plan details, entitlements, and usage.

Authentication ​

Bearer token. Minimum role: Read-only.

Path parameters ​

NameTypeRequiredDescription
slugstringYesOrganization slug

Example request ​

bash
curl 'https://dl.yengear.com/api/v2/organizations/yengear/membership/' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'

Example response ​

Summary for Read-only and Operator callers:

json
{
  "success": true,
  "data": {
    "organization": "yengear",
    "plan_name": "Pro",
    "status": "active",
    "is_active": true,
    "is_readonly": false,
    "can_write": true,
    "reason": null
  },
  "error": null
}

When can_write is false, reason is membership_readonly and write endpoints fail with the same reason. See Plan errors.

Responses ​

  • 200: Membership status.
  • 403: Authentication failed.

Update an organization ​

http
PATCH /api/v2/organizations/{slug}/

Updates the organization profile. PUT behaves the same as PATCH: send only the fields to change.

Authentication ​

User JWT with X-Organization-Slug. Minimum role: Owner (user). API tokens receive 403.

Path parameters ​

NameTypeRequiredDescription
slugstringYesOrganization slug

Request body ​

NameTypeRequiredDescription
namestringNoDisplay name
logofile | stringNoMultipart file, base64 string, or data:image/...;base64, URI. JPG, PNG, GIF, or WebP, up to 5 MB.
logoDatastringNoBase64 logo, as an alternative to logo
allow_joinbooleanNoAllow join requests
allow_searchbooleanNoShow the organization in search

slug and is_active are read-only.

Example request ​

bash
curl -X PATCH 'https://dl.yengear.com/api/v2/organizations/yengear/' \
  -H 'Authorization: Bearer YOUR_USER_JWT' \
  -H 'X-Organization-Slug: yengear' \
  -H 'Content-Type: application/json' \
  -d '{"name": "YenGear Smart Agriculture", "allow_join": true}'

Responses ​

  • 200: The updated organization object.
  • 400: Invalid field, or a logo that is not a supported image or exceeds 5 MB.
  • 403: The caller is not an Owner, the request used an API token, or the plan is read-only (membership_readonly).