Update organization

Update organization name and/or slug. Owner only. Merge semantics (RFC 7396): an absent field is left unchanged, null clears a nullable one.

PATCH/api/orgs/{orgId}

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Path Parameters

orgId*string

Request Body

application/json

curl -X PATCH "https://your-instance/api/orgs/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "name": "string",
  "slug": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "deleting_at": "2019-08-24T14:15:22Z",
  "storage": {
    "used_bytes": 0,
    "limit_bytes": 0,
    "effective_limit_bytes": 0
  },
  "members": [
    {
      "userId": "string",
      "displayName": "string",
      "email": "string",
      "role": "owner",
      "joinedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "invitations": [
    {
      "id": "string",
      "email": "string",
      "role": "owner",
      "space_assignments": [
        {
          "spaceId": "string",
          "preset_role": "admin",
          "custom_role_id": "string"
        }
      ],
      "token": "string",
      "expiresAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ]
}

{
  "type": "https://docs.appstrate.dev/errors/validation-failed",
  "title": "Validation Failed",
  "status": 400,
  "detail": "name: Invalid input: expected string, received undefined (+2 more)",
  "code": "validation_failed",
  "request_id": "req_abc123",
  "errors": [
    {
      "field": "name",
      "code": "required",
      "message": "Invalid input: expected string, received undefined"
    },
    {
      "field": "email",
      "code": "invalid_format",
      "message": "Invalid email address"
    },
    {
      "field": "age",
      "code": "invalid_type",
      "message": "Invalid input: expected number, received string"
    }
  ]
}

{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Resource not found",
  "code": "not_found",
  "request_id": "req_abc123"
}