Team API is used to manage the team members under an Agenty account. Use this API to list team members, add new member, delete a particular member, change member status or role etc.
Add a new team member
Endpoint:
Method: POST
URL: https://api.agenty.com/v1/team
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Body:
{
"email": "john@doamin.com",
"name": "John",
"role_id": 5,
"status": "active"
}
Responses:
Status: OK | Code: 200
{
"status_code": 200,
"message": "A new team member with id: 41 created successfully"
}
Get team member by id
Endpoint:
Method: GET
URL: https://api.agenty.com/v1/team/{{MEMBER_ID}}
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: OK | Code: 200
{
"user_id": 39,
"name": "John",
"email": "john@domain.com",
"status": "active",
"created_at": "2019-03-08T07:55:58",
"last_login_at": null,
"updated_at": null,
"role_id": 5,
"role_name": "Viewer"
}
Update team member by id
Endpoint:
Method: PUT
URL: https://api.agenty.com/v1/team/{{MEMBER_ID}}
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Body:
{
"user_id": 41,
"email": "john@domain.com",
"name": "John Smith",
"role_id": 4,
"status": "active"
}
Responses:
Status: OK | Code: 200
{
"status_code": 200,
"message": "Team member with id: 41 updated successfully"
}
Get all team members
Endpoint:
Method: GET
URL: https://api.agenty.com/v1/team
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: OK | Code: 200
{
"total": 2,
"limit": 1000,
"offset": 0,
"returned": 2,
"result": [
{
"user_id": 38,
"name": "John",
"email": "john@domain.com",
"status": "active",
"created_at": "2019-03-08T02:11:29",
"last_login_at": null,
"updated_at": "2019-03-08T02:11:47",
"role_id": 2,
"role_name": "Owner"
},
{
"user_id": 39,
"name": "Smith",
"email": "smith@domain.com",
"status": "active",
"created_at": "2019-03-08T07:55:58",
"last_login_at": null,
"updated_at": null,
"role_id": 5,
"role_name": "Viewer"
}
]
}
Delete team member by id
Endpoint:
Method: DELETE
URL: https://api.agenty.com/v1/team/{{MEMBER_ID}}
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: OK | Code: 200
{
"status_code": 200,
"message": "Team member with id: 39 deleted successfully"
}