Skip to content
Dashboard
Theme
Theme

Give a membership a role, optionally on one resource

POST /v1/organizations/{org}/memberships/{membership}/role_assignments: Give a membership a role, optionally on one resource.

View Markdown

POST /v1/organizations/{org}/memberships/{membership}/role_assignments

Scope
authorization:write
Auth
Secret key (sk_…)
Since
1.0
  • org string Required

  • membership string Required

  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • role string Required

    The role’s slug in the developer’s app.

  • resource AuthzResource

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/organizations/org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5/memberships/om_01J9Z3K5V7W8X9Y0Z1A2B3C4D5/role_assignments" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"role": "admin"
}'
Response 201
{
"id": "rasn_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"object": "role_assignment",
"membership": "om_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"role": "admin",
"role_id": "role_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"resource": {
"type": "default",
"id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5"
},
"source": "api",
"created_at": "2026-01-15T09:30:00Z"
}