Teammates API

Retrieve all access requests [GET]

全アクセス要求の一覧取得。 このエンドポイントを利用すると最近の全アクセス要求の一覧を取得できます。

Request

1
GET https://api.sendgrid.com/v3/scopes/requests HTTP/1.1
URI引数 必須 条件 説明
limit No Some integer 結果を取得する件数を制限します。
offset No Some integer 結果を取得する位置のオフセットを指定します。

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
HTTP/1.1 200
[
  {
    "id": 1,
    "scope_group_name": "Mail Settings",
    "username": "teammate1",
    "email": "teammate1@example.com",
    "first_name": "Teammate",
    "last_name": "One"
  },
  {
    "id": 2,
    "scope_group_name": "Stats",
    "username": "teammate2",
    "email": "teammate2@example.com",
    "first_name": "Teammate",
    "last_name": "Two"
  }
]

Deny an access request [DELETE]

アクセス要求の拒否。 このエンドポイントを利用するとあなたのアカウントへのアクセス要求を拒否できます。

Request

1
DELETE https://api.sendgrid.com/v3/scopes/requests/{request_id} HTTP/1.1
URI引数 必須 条件 説明
request_id yes String 拒否する要求のID

Response

1
HTTP/1.1 204

Approve an access request [PATCH]

アクセス要求の承認。 このエンドポイントを利用するとアクセス要求を拒否できます。

注: チームメート管理者のみが他のチームメイトの要求を承認するためにこのエンドポイントをコールできます。

Request

1
PATCH https://api.sendgrid.com/v3/scopes/requests/approve/{id} HTTP/1.1
URI引数 必須 条件 説明
id yes String 承認する要求のID

Response

1
2
3
4
HTTP/1.1 201
{
  "id": 10
}

Resend a teammate invite [POST]

チームメイトへの招待の再送信 このエンドポイントを利用するとチームメイトへの招待を再送信できます。

注: チームメイトの招待は7日間で有効期限が切れます。招待を再送信することで有効期限をリセットできます。

Request

1
POST https://api.sendgrid.com/v3/teammates/pending/{token}/resend HTTP/1.1
URI引数 必須 条件 説明
token yes String 再送信する招待のトークン

Response

1
2
3
4
5
6
7
8
9
10
HTTP/1.1 200
{
  "pending_id": "abc123abc",
  "email": "teammate1@example.com",
  "scopes": [
    "user.profile.read",
    "user.profile.update"
  ],
  "is_admin": false
}

Retrieve a list of all pending teammates [GET]

保留中の全チームメイトの一覧取得。 このエンドポイントを利用すると保留中のチームメイトの招待の一覧を取得できます。

注: 各招待は7日間有効です。招待を再送信することで有効期間を更新できます。

Request

1
GET https://api.sendgrid.com/v3/teammates/pending HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
HTTP/1.1 200
{
  "result": [
    {
      "email": "user1@example.com",
      "scopes": [
        "user.profile.read",
        "user.profile.edit"
      ],
      "is_admin": false,
      "pending_id": "abcd123abc",
      "expiration_date": 1456424263
    },
    {
      "email": "exampexample@example.com",
      "scopes": [],
      "is_admin": true,
      "pending_id": "bcde234bcd",
      "expiration_date": 1456424263
    }
  ]
}

Delete a pending teammate invite [DELETE]

保留中の招待の削除。 このエンドポイントを利用すると保留中のチームメイトの招待を削除できます。

Request

1
DELETE https://api.sendgrid.com/v3/teammates/pending/{token} HTTP/1.1
URI引数 必須 条件 説明
token yes String 削除する招待のトークン

Response

1
HTTP/1.1 204

Invite a teammate [POST]

チームメイトへの招待。 このエンドポイントを利用すると予め定義されたスコープや権限を持ったチームメイトに招待メールを送信できます。チームメイトへの招待は7日間有効ですが、招待を再送信することでいつでも有効期限をリセットすることができます。Essentialsプラン、Freeプランのアカウントで作成できるチームメイト数は2つです。Pro以上のプランでは1000まで作成できます。

Request

1
POST https://api.sendgrid.com/v3/teammates HTTP/1.1
Request Body
1
2
3
4
5
6
7
8
{
  "email": "teammate1@example.com",
  "scopes": [
    "user.profile.read",
    "user.profile.update"
  ],
  "is_admin": false
}

Response

1
2
3
4
5
6
7
8
9
10
HTTP/1.1 201
{
  "pending_id": "abc123abc",
  "email": "teammate1@example.com",
  "scopes": [
    "user.profile.read",
    "user.profile.update"
  ],
  "is_admin": false
}

Retrieve a list of all teammates [GET]

チームメイトの一覧取得。 このエンドポイントを利用すると現在のチーム名と一覧を取得できます。

Request

1
GET https://api.sendgrid.com/v3/teammates HTTP/1.1
URI引数 必須 条件 説明
limit No Some integer 結果を取得する件数を制限します。
offset No Some integer 結果を取得する位置のオフセットを指定します。

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
HTTP/1.1 200
{
  "results": [
    {
      "username": "teammate1",
      "email": "teammate1@example.com",
      "first_name": "Jane",
      "last_name": "Doe",
      "user_type": "owner",
      "is_admin": true,
      "phone": "123-345-3453",
      "website": "www.example.com",
      "company": "ACME Inc.",
      "address": "123 Acme St",
      "address2": "",
      "city": "City",
      "state": "CA",
      "country": "USA",
      "zip": "12345"
    },
    {
      "username": "teammate2",
      "email": "teammate2@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "user_type": "teammate",
      "is_admin": false,
      "phone": "123-345-3453",
      "website": "www.example.com",
      "company": "ACME Inc.",
      "address": "123 Acme St",
      "address2": "",
      "city": "City",
      "state": "CA",
      "country": "USA",
      "zip": "12345"
    },
    {
      "username": "teammate3",
      "email": "example@example.com",
      "first_name": "Steve",
      "last_name": "Doe",
      "user_type": "admin",
      "is_admin": true,
      "phone": "123-345-3453",
      "website": "www.example.com",
      "company": "ACME Inc.",
      "address": "123 Acme St",
      "address2": "",
      "city": "City",
      "state": "CA",
      "country": "USA",
      "zip": "12345"
    }
  ]
}

Retrieve a specific teammate [GET]

特定のチームメイトの取得。 このエンドポイントを利用すると指定したusernameのチームメイトを取得できます。

Request

1
GET https://api.sendgrid.com/v3/teammates/{username} HTTP/1.1
URI引数 必須 条件 説明
username Yes String 取得するチームメイトのユーザ名

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
HTTP/1.1 200
{
  "username": "teammate1",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "teammate1@example.com",
  "scopes": [
    "user.profile.read",
    "user.profile.update",
    "..."
  ],
  "user_type": "admin",
  "is_admin": true,
  "phone": "123-345-3453",
  "website": "www.example.com",
  "company": "ACME Inc.",
  "address": "123 Acme St",
  "address2": "",
  "city": "City",
  "state": "CA",
  "country": "USA",
  "zip": "12345"
}

Update teammate’s permissions [PATCH]

チームメイトのパーミッションの更新。 このエンドポイントを利用するとチームメイトのパーミッションを更新できます。

チームメイトを管理者に変更するには、要求でis_admintrueを設定する必要があります。もしくは、is_adminfalseを設定して全スコープを与える方法もあります。

親アカウントまたは他の管理者チームメイトのみが他のチームメイトのパーミッションを更新できます。

管理ユーザのみがパーミッションを更新できます。

Request

1
PATCH https://api.sendgrid.com/v3/teammates/{username} HTTP/1.1
Request Body
1
2
3
4
5
6
7
{
  "scopes": [
    "user.profile.read",
    "user.profile.edit"
  ],
  "is_admin": false
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
HTTP/1.1 200
{
  "username": "teammate1",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "teammate1@example.com",
  "scopes": [
    "user.profile.read",
    "user.profile.edit"
  ],
  "user_type": "teammate",
  "is_admin": false,
  "phone": "123-345-3453",
  "website": "www.example.com",
  "company": "ACME Inc.",
  "address": "123 Acme St",
  "address2": "",
  "city": "City",
  "state": "CA",
  "country": "USA",
  "zip": "12345"
}

Delete a teammate [DELETE]

チームメイトの削除。 このエンドポイントを利用するとチームメイトを削除できます。

親アカウントまたは管理者チームメイトのみが他のチームメイトを削除できます。

Request

1
DELETE https://api.sendgrid.com/v3/teammates/{username} HTTP/1.1

Response

1
HTTP/1.1 204