1. Organizations
  2. Retrieve Organizations

Organizations

Retrieve Organizations

Retrieve Organization

Just like when updating organizations, you can either use the full organization ID in proper RESTful fashion, or you can use the org shortcut since your API key is scoped to the organization anyway.

GET
`/v1/organizations/:organization`
GET
`/v1/org`
js
        const response = await fetch("https://api.packagex.io/v1/org", {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
});

const org = response.data;

      

List Organizations

GET
`/v1/organizations`

While the API exists for completeness, you will never have more than one organization scoped to an API key. Therefore, this endpoint will always return a single organization, just in an array.

js
        const response = await fetch("https://api.packagex.io/v1/organizations", {
  method: "GET",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
}).then((res) => res.json());

const org = response.data[0]; //There will always only be one response
const pagination = response.pagination; //The has_more property will be null