# Teams

### The Team object

| Attribute   | Type   | Description                                      |
| ----------- | ------ | ------------------------------------------------ |
| id          | string | Unique team identifier                           |
| name        | string | Team name                                        |
| created\_at | string | Time when the team was created. RFC 3339 format. |

Example:

```javascript
{
  "id": "16682617-f25d-4df2-9f51-3c38298996b8",
  "name": "Product Engineering",
  "created_at": "2018-02-20T12:32:56Z"
}
```

## Create Team

<mark style="color:green;">`POST`</mark> `https://api.simpleokr.com/v1/teams`

Create a new Team object.

#### Request Body

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
| name | string | Name of the team |

{% tabs %}
{% tab title="200 On success, a new Team object is returned." %}

```javascript
{
  "id": "16682617-f25d-4df2-9f51-3c38298996b8",
  "name": "Product Engineering",
  "created_at": "2018-02-20T12:32:56Z"
}
```

{% endtab %}
{% endtabs %}

## List Teams

<mark style="color:blue;">`GET`</mark> `https://api.simpleokr.com/v1/teams`

Returns a list of your teams.

#### Query Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| page\_token | string | Page number |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "next_page_token": null,
  "teams": [
    {
      "id": "16682617-f25d-4df2-9f51-3c38298996b8",
      "name": "Product Engineering",
      "created_at": "2018-02-20T12:32:56Z"
    },
    {...},
    {...}
  ]
}
```

{% endtab %}
{% endtabs %}

## Retrieve Team

<mark style="color:blue;">`GET`</mark> `https://api.simpleokr.com/v1/teams/:id`

Retrieve details about the existing Team. Supply the unique Team ID from either a team creation response or team list response.

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | string | Team ID     |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "id": "16682617-f25d-4df2-9f51-3c38298996b8",
  "name": "Product Engineering",
  "created_at": "2018-02-20T12:32:56Z"
}
```

{% endtab %}
{% endtabs %}

## Update Team

<mark style="color:green;">`POST`</mark> `https://api.simpleokr.com/v1/teams/:id`

Update details of an existing team

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | string | Team ID     |

#### Request Body

| Name | Type   | Description   |
| ---- | ------ | ------------- |
| name | string | New team name |

{% tabs %}
{% tab title="200 Responds with an updated Team object." %}

```javascript
{
  "id": "16682617-f25d-4df2-9f51-3c38298996b8",
  "name": "Product Engineering",
  "created_at": "2018-02-20T12:32:56Z"
}
```

{% endtab %}
{% endtabs %}

## Delete Team

<mark style="color:red;">`DELETE`</mark> `https://api.simpleokr.com/v1/teams/:id`

Delete an existing Team.

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}
