Add Organization Roles
Requires IAM-token for authorization.
Request
POST
https://api.sourcecraft.tech/orgs/{org_slug}/roles
Path parameters
|
Name |
Description |
|
org_slug |
Type: string Example: `` |
Query parameters
|
Name |
Description |
|
org_id |
Type: string Example: `` |
Body
application/json
{
"repo_subject_roles": [
{
"role": "viewer",
"subject": {
"type": "user",
"id": "example"
}
}
]
}
|
Name |
Description |
|
repo_subject_roles |
Type: SubjectRole[] List of repository roles that will be set on the organization level. These roles are inherited by all repositories in the organization. Example
|
RepoRole
Type: string
Enum: viewer, contributor, developer, maintainer, admin
SubjectType
Type: string
Enum: user, invitee, team
Subject
|
Name |
Description |
|
id |
Type: string Example: |
|
type |
Type: SubjectType Enum: |
Example
{
"type": "user",
"id": "example"
}
SubjectRole
|
Name |
Description |
|
role |
Type: RepoRole Enum: |
|
subject |
Type: Subject Example
|
Example
{
"role": "viewer",
"subject": {
"type": "user",
"id": "example"
}
}
Responses
200 OK
A successful response.
Body
application/json
{}
Type: object
default
Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme
Body
application/json
{
"error_code": "example",
"message": "example",
"request_id": "example",
"details": {}
}
|
Name |
Description |
||
|
details |
Type: Optional details. Exact structure depends on error_code
Example
|
||
|
error_code |
Type: string Example: |
||
|
message |
Type: string Example: |
||
|
request_id |
Type: string Example: |