# Add Role

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Add Role"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/organization/{organization_id}/roles"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Adds a role to the specified organization.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"The ID of the organization","in":"path","name":"organization_id","required":true,"schema":{"description":"The ID of the organization","format":"uuid","title":"Organization Id","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"description":"The role to add to the specified organization.","properties":{"description":{"description":"The description of the role","title":"Description","type":"string"},"permissions":{"description":"The permissions of the role","items":{"properties":{"action":{"description":"Actions are the operations that can be performed on an asset.\nCurrently defined actions are:\n- read\n- write\n\nWhen allowing write we assume that users can also read.\nThis is a simplification that we can revisit later.","enum":["read","write"],"title":"Action","type":"string"},"asset":{"description":"Assets are the resources that are protected by the authorization system and are scoped to workspaces.","enum":["feedback","feedback_management","files","indexes","jobs","secrets","shared_prototypes","pipelines","prompts","search_history","workspace_statistics","workspace_members","groundedness","api_keys","models","tool_registry","component_templates","mcp_server","*"],"title":"Assets","type":"string"}},"required":["asset","action"],"title":"Permission","type":"object"},"title":"Permissions","type":"array"},"role_name":{"description":"The name of the role","title":"Role Name","type":"string"}},"required":["role_name","description","permissions"],"title":"AddRoleBody","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"content":{"application/json":{"schema":{"description":"A response model for the RBACRole.\nThis is used to return the RBACRole to the client.","properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The description of the role","title":"Description"},"is_custom":{"description":"Whether the role is a predefined role or a custom role.","title":"Is Custom","type":"boolean"},"permissions":{"description":"The permissions of the role","items":{"properties":{"action":{"description":"Actions are the operations that can be performed on an asset.\nCurrently defined actions are:\n- read\n- write\n\nWhen allowing write we assume that users can also read.\nThis is a simplification that we can revisit later.","enum":["read","write"],"title":"Action","type":"string"},"asset":{"description":"Assets are the resources that are protected by the authorization system and are scoped to workspaces.","enum":["feedback","feedback_management","files","indexes","jobs","secrets","shared_prototypes","pipelines","prompts","search_history","workspace_statistics","workspace_members","groundedness","api_keys","models","tool_registry","component_templates","mcp_server","*"],"title":"Assets","type":"string"}},"required":["asset","action"],"title":"Permission","type":"object"},"title":"Permissions","type":"array"},"role_id":{"description":"The ID of the role","format":"uuid","title":"Role Id","type":"string"},"role_name":{"description":"The name of the role","title":"Role Name","type":"string"}},"required":["role_name","description","role_id","is_custom","permissions"],"title":"RBACRoleController","type":"object"}}},"description":"The role that was added to the specified organization."},"404":{"description":"Organization not found"},"409":{"description":"Role already exists"},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
