Create a new team
POST
/api/v1/team
const url = 'https://app.prefactorai.com/api/v1/team';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"013xrzp12g3nqk8ns6jadrqmpgrjkeny","name":"Sales"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.prefactorai.com/api/v1/team \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "name": "Sales" }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Responses
Section titled “Responses”Success
Media typeapplication/json
object
details
required
Team_Details
Full details of a team
object
agent_count
required
Number of agents assigned to this team
integer
id
required
Team_Id
A valid team ID
string
inserted_at
required
When the team was created
string format: date-time
name
required
Team name
string
people_count
required
Number of people on this team
integer
type
required
Type of resource (always ‘team’)
string
updated_at
required
When the team was last updated
string format: date-time
status
required
Response status when the operation succeeds
string
Example
{ "details": { "agent_count": 2, "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "name": "Sales", "people_count": 3, "type": "team", "updated_at": "2024-01-01T00:00:00Z" }, "status": "success"}default
Section titled “default”Error
Media typeapplication/json
One of:
object
code
required
string
message
required
string
status
required
string
object
code
required
string
errors
required
object
key
additional properties
object recursive
message
required
string
status
required
string
object
code
required
string
message
required
string
retry_after_ms
required
Milliseconds until the client may retry.
integer
status
required
string
Example
{ "code": "bad_request", "status": "error"}