Organization ID

Retrieve data on your organizations, per organization ID.

Fetch User's Organizations ID

Retrieving the user's organization info is done through querying the user's information. One can query details inside the organization.

Note that you can fetch more than just the organization ID, all depending on what you're filling in the query.

query User($where: UserWhereUniqueInput!) {
  user(where: $where) {
    organizations {
      id
      name
    }
  }
}

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Body (UserWhereUniqueInput object)

NameTypeDescription

id*

string

ID of the logged in user. See Authorization.

{
  "where": {
    "id": "userId123"
  }
}

Response

Returned values:

NameTypeDescription

id

string

Organization ID

name

string

Organization name

{
  "data": {
    "user": {
      "organizations": [
        {
          "id": "clilpvru98723678mwie82oihn9",
          "name": "Crypto Org 1"
        }
      ]
    }
  }
}

Try it out!

Last updated