Passer au contenu principal
POST
/
organizations
/
{id}
/
client-grants
TypeScript
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.organizations.clientGrants.create("id", {
        grantId: "grant_id",
    });
}
main();
{
  "id": "<string>",
  "client_id": "<string>",
  "audience": "<string>",
  "scope": [
    "<string>"
  ],
  "organization_usage": "deny",
  "allow_any_organization": true
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

id
string
requis

Organization identifier.

Maximum string length: 50

Corps

grant_id
string<client-grant-id>
requis

A Client Grant ID to add to the organization.

Réponse

Client Grant successfully associated with Organization.

id
string

ID of the client grant.

client_id
string

ID of the client.

audience
string

The audience (API identifier) of this client grant

Minimum string length: 1
scope
string[]

Scopes allowed for this client grant.

Minimum string length: 1
organization_usage
enum<string>

Defines whether organizations can be used with client credentials exchanges for this grant.

Options disponibles:
deny,
allow,
require
allow_any_organization
boolean

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.