# Organization

> Inspect your authenticated profile, active workspace memberships, and create or rename organizations.

## Who am I and which organizations can I use

`GET https://shaw.ai/api/me`

Returns the signed-in person, the organizations they can open, and the organization this request acts for.

```json
{
  "openapi": "3.1.0",
  "info": {
    "description": "Shaw's API for people and agents. Everything you can do in the app, you can do here with an API key or an OAuth token, within the scopes you grant it.\n\nA scope only narrows a credential: every request still runs as the person who owns it, with their role in the organization.\n\nRoutes under /api/skills, /api/harness-profiles, /api/data-sync, /api/templates, /api/seo are reachable with the matching read or write scope (GET reads, everything else writes) even where no typed operation is listed here.\n\nWebhook events: approval.decided, session.completed, schedule.run.started, schedule.run.failed.\n\nMCP: https://shaw.ai/mcp (also https://shaw.ai/portal/mcp).",
    "title": "Shaw API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://shaw.ai"
    }
  ],
  "paths": {
    "/api/me": {
      "get": {
        "description": "Returns the signed-in person, the organizations they can open, and the organization this request acts for.",
        "operationId": "get_me",
        "parameters": [
          {
            "$ref": "#/components/parameters/Tenant"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "org:read"
            ]
          }
        ],
        "summary": "Who am I and which organizations can I use",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "get_me",
        "x-requires-confirmation": false,
        "x-required-scope": "org:read"
      }
    }
  },
  "components": {
    "parameters": {
      "Tenant": {
        "description": "The organization to act for (an id from `GET /api/me`). Defaults to the key's pinned organization, else your first organization. You must be a member of it.",
        "in": "header",
        "name": "X-Shaw-Tenant",
        "required": false,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The request was refused or failed; `error` is a stable code."
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "enum": [
                    "insufficient_scope",
                    "bearer_not_allowed",
                    "forbidden_workspace",
                    "tenant_pinned"
                  ],
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential lacks the scope, can't call this route, or can't act for the organization."
      },
      "Ok": {
        "content": {
          "application/json": {
            "schema": {}
          }
        },
        "description": "Success. The body is JSON."
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential is missing, invalid, expired or revoked.",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "bearerFormat": "sk_…",
        "description": "A personal API key created in Settings → Developers. Send it as `Authorization: Bearer sk_…`.",
        "scheme": "bearer",
        "type": "http"
      },
      "oauth2": {
        "description": "OAuth 2.1 authorization code with S256 PKCE. Clients can register themselves (RFC 7591).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://shaw.ai/api/auth/oauth2/authorize",
            "refreshUrl": "https://shaw.ai/api/auth/oauth2/token",
            "scopes": {
              "org:read": "See which organizations you belong to, their profile and runtime status.",
              "org:write": "Create organizations and rename the ones you administer.",
              "sessions:read": "Read chat sessions, their messages and artifacts.",
              "sessions:write": "Start, rename, fork, compact and archive chat sessions and send messages.",
              "approvals:review": "Approve or reject the actions a session is waiting on.",
              "files:read": "Read shared files and documents.",
              "files:write": "Create, edit and delete shared files and documents.",
              "memory:read": "Read the knowledge base and shared memory.",
              "memory:write": "Add, edit, restore and delete knowledge entries.",
              "schedules:read": "Read scheduled automations.",
              "schedules:write": "Change and run scheduled automations.",
              "campaigns:read": "Read synced advertising, sales and Meta/Google campaign data.",
              "campaigns:write": "Run syncs and publish or change ad campaigns.",
              "reports:read": "Read SEO reports and research.",
              "reports:write": "Run and change SEO reports and research.",
              "pages:read": "Read template catalog metadata, code size/credits, Brand Kit, remixes, hosted pages, custom domains, and Email Studio drafts.",
              "pages:write": "Update Brand Kit, create or edit remixes, publish hosted pages or domains, and edit or publish Email Studio drafts.",
              "connectors:read": "See which apps and providers are connected, without any credentials.",
              "connectors:manage": "Disconnect apps, forget saved provider keys and manage MCP servers. Connecting an app or entering a credential needs you signed in.",
              "members:read": "See who belongs to an organization and their roles.",
              "members:manage": "Invite people and change or remove members.",
              "settings:read": "Read workspace settings, tool policy, skills and models.",
              "settings:write": "Change workspace settings, tool policy and skills.",
              "webhooks:manage": "Create, list and delete outbound webhooks.",
              "events:read": "Read the activity feed and webhook delivery log.",
              "tools:read": "Use read-only integration tools (Shopify, Klaviyo and others) the organization has connected.",
              "tools:write": "Use integration tools that change data in connected apps. Writes still follow the organization's tool policy."
            },
            "tokenUrl": "https://shaw.ai/api/auth/oauth2/token"
          }
        },
        "type": "oauth2"
      }
    },
    "schemas": {}
  }
}
```

## Create an organization

`POST https://shaw.ai/api/organizations`

Creates a private organization with the caller as its admin. Only people allowed to create organizations can; check `canCreateOrganization` in get_me.

```json
{
  "openapi": "3.1.0",
  "info": {
    "description": "Shaw's API for people and agents. Everything you can do in the app, you can do here with an API key or an OAuth token, within the scopes you grant it.\n\nA scope only narrows a credential: every request still runs as the person who owns it, with their role in the organization.\n\nRoutes under /api/skills, /api/harness-profiles, /api/data-sync, /api/templates, /api/seo are reachable with the matching read or write scope (GET reads, everything else writes) even where no typed operation is listed here.\n\nWebhook events: approval.decided, session.completed, schedule.run.started, schedule.run.failed.\n\nMCP: https://shaw.ai/mcp (also https://shaw.ai/portal/mcp).",
    "title": "Shaw API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://shaw.ai"
    }
  ],
  "paths": {
    "/api/organizations": {
      "post": {
        "description": "Creates a private organization with the caller as its admin. Only people allowed to create organizations can; check `canCreateOrganization` in get_me.",
        "operationId": "create_organization",
        "parameters": [
          {
            "$ref": "#/components/parameters/Tenant"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "description": "The new organization's name.",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "org:write"
            ]
          }
        ],
        "summary": "Create an organization",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "create_organization",
        "x-requires-confirmation": true,
        "x-required-scope": "org:write"
      }
    }
  },
  "components": {
    "parameters": {
      "Tenant": {
        "description": "The organization to act for (an id from `GET /api/me`). Defaults to the key's pinned organization, else your first organization. You must be a member of it.",
        "in": "header",
        "name": "X-Shaw-Tenant",
        "required": false,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The request was refused or failed; `error` is a stable code."
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "enum": [
                    "insufficient_scope",
                    "bearer_not_allowed",
                    "forbidden_workspace",
                    "tenant_pinned"
                  ],
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential lacks the scope, can't call this route, or can't act for the organization."
      },
      "Ok": {
        "content": {
          "application/json": {
            "schema": {}
          }
        },
        "description": "Success. The body is JSON."
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential is missing, invalid, expired or revoked.",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "bearerFormat": "sk_…",
        "description": "A personal API key created in Settings → Developers. Send it as `Authorization: Bearer sk_…`.",
        "scheme": "bearer",
        "type": "http"
      },
      "oauth2": {
        "description": "OAuth 2.1 authorization code with S256 PKCE. Clients can register themselves (RFC 7591).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://shaw.ai/api/auth/oauth2/authorize",
            "refreshUrl": "https://shaw.ai/api/auth/oauth2/token",
            "scopes": {
              "org:read": "See which organizations you belong to, their profile and runtime status.",
              "org:write": "Create organizations and rename the ones you administer.",
              "sessions:read": "Read chat sessions, their messages and artifacts.",
              "sessions:write": "Start, rename, fork, compact and archive chat sessions and send messages.",
              "approvals:review": "Approve or reject the actions a session is waiting on.",
              "files:read": "Read shared files and documents.",
              "files:write": "Create, edit and delete shared files and documents.",
              "memory:read": "Read the knowledge base and shared memory.",
              "memory:write": "Add, edit, restore and delete knowledge entries.",
              "schedules:read": "Read scheduled automations.",
              "schedules:write": "Change and run scheduled automations.",
              "campaigns:read": "Read synced advertising, sales and Meta/Google campaign data.",
              "campaigns:write": "Run syncs and publish or change ad campaigns.",
              "reports:read": "Read SEO reports and research.",
              "reports:write": "Run and change SEO reports and research.",
              "pages:read": "Read template catalog metadata, code size/credits, Brand Kit, remixes, hosted pages, custom domains, and Email Studio drafts.",
              "pages:write": "Update Brand Kit, create or edit remixes, publish hosted pages or domains, and edit or publish Email Studio drafts.",
              "connectors:read": "See which apps and providers are connected, without any credentials.",
              "connectors:manage": "Disconnect apps, forget saved provider keys and manage MCP servers. Connecting an app or entering a credential needs you signed in.",
              "members:read": "See who belongs to an organization and their roles.",
              "members:manage": "Invite people and change or remove members.",
              "settings:read": "Read workspace settings, tool policy, skills and models.",
              "settings:write": "Change workspace settings, tool policy and skills.",
              "webhooks:manage": "Create, list and delete outbound webhooks.",
              "events:read": "Read the activity feed and webhook delivery log.",
              "tools:read": "Use read-only integration tools (Shopify, Klaviyo and others) the organization has connected.",
              "tools:write": "Use integration tools that change data in connected apps. Writes still follow the organization's tool policy."
            },
            "tokenUrl": "https://shaw.ai/api/auth/oauth2/token"
          }
        },
        "type": "oauth2"
      }
    },
    "schemas": {}
  }
}
```

## Rename an organization

`PATCH https://shaw.ai/api/organizations/{id}`

Organization admins only.

```json
{
  "openapi": "3.1.0",
  "info": {
    "description": "Shaw's API for people and agents. Everything you can do in the app, you can do here with an API key or an OAuth token, within the scopes you grant it.\n\nA scope only narrows a credential: every request still runs as the person who owns it, with their role in the organization.\n\nRoutes under /api/skills, /api/harness-profiles, /api/data-sync, /api/templates, /api/seo are reachable with the matching read or write scope (GET reads, everything else writes) even where no typed operation is listed here.\n\nWebhook events: approval.decided, session.completed, schedule.run.started, schedule.run.failed.\n\nMCP: https://shaw.ai/mcp (also https://shaw.ai/portal/mcp).",
    "title": "Shaw API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://shaw.ai"
    }
  ],
  "paths": {
    "/api/organizations/{id}": {
      "patch": {
        "description": "Organization admins only.",
        "operationId": "rename_organization",
        "parameters": [
          {
            "$ref": "#/components/parameters/Tenant"
          },
          {
            "description": "The organization id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "description": "The new name.",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "org:write"
            ]
          }
        ],
        "summary": "Rename an organization",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "rename_organization",
        "x-requires-confirmation": false,
        "x-required-scope": "org:write"
      }
    }
  },
  "components": {
    "parameters": {
      "Tenant": {
        "description": "The organization to act for (an id from `GET /api/me`). Defaults to the key's pinned organization, else your first organization. You must be a member of it.",
        "in": "header",
        "name": "X-Shaw-Tenant",
        "required": false,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The request was refused or failed; `error` is a stable code."
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "enum": [
                    "insufficient_scope",
                    "bearer_not_allowed",
                    "forbidden_workspace",
                    "tenant_pinned"
                  ],
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential lacks the scope, can't call this route, or can't act for the organization."
      },
      "Ok": {
        "content": {
          "application/json": {
            "schema": {}
          }
        },
        "description": "Success. The body is JSON."
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The credential is missing, invalid, expired or revoked.",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "bearerFormat": "sk_…",
        "description": "A personal API key created in Settings → Developers. Send it as `Authorization: Bearer sk_…`.",
        "scheme": "bearer",
        "type": "http"
      },
      "oauth2": {
        "description": "OAuth 2.1 authorization code with S256 PKCE. Clients can register themselves (RFC 7591).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://shaw.ai/api/auth/oauth2/authorize",
            "refreshUrl": "https://shaw.ai/api/auth/oauth2/token",
            "scopes": {
              "org:read": "See which organizations you belong to, their profile and runtime status.",
              "org:write": "Create organizations and rename the ones you administer.",
              "sessions:read": "Read chat sessions, their messages and artifacts.",
              "sessions:write": "Start, rename, fork, compact and archive chat sessions and send messages.",
              "approvals:review": "Approve or reject the actions a session is waiting on.",
              "files:read": "Read shared files and documents.",
              "files:write": "Create, edit and delete shared files and documents.",
              "memory:read": "Read the knowledge base and shared memory.",
              "memory:write": "Add, edit, restore and delete knowledge entries.",
              "schedules:read": "Read scheduled automations.",
              "schedules:write": "Change and run scheduled automations.",
              "campaigns:read": "Read synced advertising, sales and Meta/Google campaign data.",
              "campaigns:write": "Run syncs and publish or change ad campaigns.",
              "reports:read": "Read SEO reports and research.",
              "reports:write": "Run and change SEO reports and research.",
              "pages:read": "Read template catalog metadata, code size/credits, Brand Kit, remixes, hosted pages, custom domains, and Email Studio drafts.",
              "pages:write": "Update Brand Kit, create or edit remixes, publish hosted pages or domains, and edit or publish Email Studio drafts.",
              "connectors:read": "See which apps and providers are connected, without any credentials.",
              "connectors:manage": "Disconnect apps, forget saved provider keys and manage MCP servers. Connecting an app or entering a credential needs you signed in.",
              "members:read": "See who belongs to an organization and their roles.",
              "members:manage": "Invite people and change or remove members.",
              "settings:read": "Read workspace settings, tool policy, skills and models.",
              "settings:write": "Change workspace settings, tool policy and skills.",
              "webhooks:manage": "Create, list and delete outbound webhooks.",
              "events:read": "Read the activity feed and webhook delivery log.",
              "tools:read": "Use read-only integration tools (Shopify, Klaviyo and others) the organization has connected.",
              "tools:write": "Use integration tools that change data in connected apps. Writes still follow the organization's tool policy."
            },
            "tokenUrl": "https://shaw.ai/api/auth/oauth2/token"
          }
        },
        "type": "oauth2"
      }
    },
    "schemas": {}
  }
}
```
