# Assign Role

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

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

Assign Role

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

<ParamsDetails
  parameters={[{"description":"A unique identifier of the user. You can obtain it from the Get Users endpoint.","in":"path","name":"user_id","required":true,"schema":{"description":"A unique identifier of the user. You can obtain it from the Get Users endpoint.","format":"uuid","title":"User Id","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"description":"Specify the workspace name and role to assign to the user","properties":{"role_id":{"description":"Unique identifier of the role.","format":"uuid","title":"Role ID","type":"string"},"workspace_name":{"description":"Name of the workspace.","title":"Workspace Name","type":"string"}},"required":["workspace_name","role_id"],"title":"AssignedRoleRequest","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"204":{"description":"Successful Response"},"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>
