Actors
Actors represent any entity that can be targeted by a flag. Actors will be typically users, but you can also flag teams, workspaces, groups, repositories,... or any type of entity in your system.
Endpoints
GET/projects/{projectId}/actors
List all actors in a project
List actors of a project
Path parameters
- Name
projectId
- Type
- string
- Description
- Required The project id
Query parameters
- Name
before
- Type
- string
- Description
- Show results before this cursor
- Name
after
- Type
- string
- Description
- Show results after this cursor
- Name
q
- Type
- string
- Description
- Search by id and name
Request
GET
/projects/{projectId}/actorsconst options = {method: 'GET', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
fetch('https://api.groundcontrol.sh/projects/P091PL4M90ZWQUZ0/actors', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
{
"data": [
{
"actorId": "example",
"imageURL": "example",
"name": "example",
"createdAt": "example"
}
],
"pagination": {
"before": "YWJjZDEyMzQ1Njc4OTB4eXo=",
"after": "MTIzNGFiY2RlZmdoaWprbG1ubw=="
}
}
GET/projects/{projectId}/actors/{actorId}
Retrieve an actor
Retrieve an actor
Path parameters
- Name
projectId
- Type
- string
- Description
- Required The project id
- Name
actorId
- Type
- string
- Description
- Required The actor id
Request
GET
/projects/{projectId}/actors/{actorId}const options = {method: 'GET', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
fetch('https://api.groundcontrol.sh/projects/P091PL4M90ZWQUZ0/actors/user:1234', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
{
"actorId": "example",
"imageURL": "example",
"name": "example",
"createdAt": "example"
}
PATCH/projects/{projectId}/actors/{actorId}
Update an actor
Update an actor
Path parameters
- Name
projectId
- Type
- string
- Description
- Required The project id
- Name
actorId
- Type
- string
- Description
- Required The actor id
Request body
- Name
name
- Type
- string
- Description
- Actor name
- Name
imageURL
- Type
- string
- Description
- Image URL
Request
PATCH
/projects/{projectId}/actors/{actorId}const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'},
body: '{"name":"example","imageURL":"example"}'
};
fetch('https://api.groundcontrol.sh/projects/P091PL4M90ZWQUZ0/actors/user:1234', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
{
"actorId": "example",
"imageURL": "example",
"name": "example",
"createdAt": "example"
}
GET/projects/{projectId}/flags/{flagName}/actors
List actors for a flag
List actors a flag is enabled for
Path parameters
- Name
projectId
- Type
- string
- Description
- Required The project id
- Name
flagName
- Type
- string
- Description
- Required The flag name
Query parameters
- Name
before
- Type
- string
- Description
- Show results before this cursor
- Name
after
- Type
- string
- Description
- Show results after this cursor
Request
GET
/projects/{projectId}/flags/{flagName}/actorsconst options = {method: 'GET', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
fetch('https://api.groundcontrol.sh/projects/P091PL4M90ZWQUZ0/flags/my-flag/actors', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
{
"data": [
{
"actorId": "example",
"imageURL": "example",
"name": "example",
"createdAt": "example"
}
],
"pagination": {
"before": "YWJjZDEyMzQ1Njc4OTB4eXo=",
"after": "MTIzNGFiY2RlZmdoaWprbG1ubw=="
}
}
GET/projects/{projectId}/segments/{segmentId}/actors
List actors for a segment
List actors of a project
Path parameters
- Name
projectId
- Type
- string
- Description
- Required The project id
- Name
segmentId
- Type
- string
- Description
- Required The segment id
Query parameters
- Name
before
- Type
- string
- Description
- Show results before this cursor
- Name
after
- Type
- string
- Description
- Show results after this cursor
Request
GET
/projects/{projectId}/segments/{segmentId}/actorsconst options = {method: 'GET', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
fetch('https://api.groundcontrol.sh/projects/P091PL4M90ZWQUZ0/segments/S091PL4M90ZWQUZ0/actors', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
{
"data": [
{
"actorId": "example",
"imageURL": "example",
"name": "example",
"createdAt": "example"
}
],
"pagination": {
"before": "YWJjZDEyMzQ1Njc4OTB4eXo=",
"after": "MTIzNGFiY2RlZmdoaWprbG1ubw=="
}
}