HydraCore
API by router

Team

List Invitations

List all invitations for the current team.

Admins and owners can see all invitations. "Papers, please." — Inspector, Papers Please

GET
/v1/team/invitations
AuthorizationBearer <token>

In: header

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X GET "https://loading/v1/team/invitations" \  -H "X-Api-Key: string"
[
  {
    "created_at": "2019-08-24T14:15:22Z",
    "email": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "invited_by": "0fdabe0c-eb7c-440a-96d2-2c65906c3777",
    "invited_by_email": "string",
    "role": "string",
    "status": "string",
    "token": "string"
  }
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Accept Invitation

Accept a team invitation.

The authenticated user accepts the invite. Their customer_id is switched to the inviting team's customer, and they get the invited role.

"Welcome to the party, pal!" — John McClane, Die Hard

POST
/v1/team/invitations/accept
AuthorizationBearer <token>

In: header

tokenToken
Length1 <= length <= 64

Response Body

curl -X POST "https://loading/v1/team/invitations/accept" \  -H "Content-Type: application/json" \  -d '{    "token": "string"  }'
{
  "created_at": "2019-08-24T14:15:22Z",
  "display_name": "string",
  "email": "string",
  "is_active": true,
  "is_admin": true,
  "last_login": "2019-08-24T14:15:22Z",
  "team_role": "string",
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Revoke Invitation

Revoke a pending invitation.

"You're fired!" — Donald Trump / also Stryker in Hot Shots! Part Deux

DELETE
/v1/team/invitations/{invitation_id}
AuthorizationBearer <token>

In: header

Path Parameters

invitation_idInvitation Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X DELETE "https://loading/v1/team/invitations/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "X-Api-Key: string"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Invite Member

Invite someone to join the team by email.

Only owners and admins can send invitations. You can't invite someone who's already on the team, and you can't grant a role higher than your own.

"I'm putting together a special team." — Nick Fury, The Avengers

POST
/v1/team/invite
AuthorizationBearer <token>

In: header

Header Parameters

X-Api-Key?X-Api-Key
emailEmail
Formatemail
role?Role

Team role for the invitee

Default"member"

Response Body

curl -X POST "https://loading/v1/team/invite" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com"  }'
{
  "created_at": "2019-08-24T14:15:22Z",
  "email": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "invited_by": "0fdabe0c-eb7c-440a-96d2-2c65906c3777",
  "invited_by_email": "string",
  "role": "string",
  "status": "string",
  "token": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

List Team Members

List all members of the current user's team.

Any team member can see the list. It's not a secret club. "First rule of Fight Club: you do not talk about Fight Club." — Tyler Durden (but this isn't Fight Club, so go ahead)

GET
/v1/team/members
AuthorizationBearer <token>

In: header

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X GET "https://loading/v1/team/members" \  -H "X-Api-Key: string"
[
  {
    "created_at": "2019-08-24T14:15:22Z",
    "display_name": "string",
    "email": "string",
    "is_active": true,
    "is_admin": true,
    "last_login": "2019-08-24T14:15:22Z",
    "team_role": "string",
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
  }
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Remove Member

Remove a member from the team.

Owners can remove anyone. Admins can remove members and billing users. You can remove yourself (leave the team) unless you're the last owner.

"Get to the chopper!" — Dutch, Predator (about leaving the team)

DELETE
/v1/team/members/{member_id}
AuthorizationBearer <token>

In: header

Path Parameters

member_idMember Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X DELETE "https://loading/v1/team/members/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "X-Api-Key: string"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Update Member Role

Update a team member's role.

Only owners can promote to admin. Admins can set member/billing roles. Nobody can demote the last owner. That would be anarchy.

"You have no power here, Gandalf the Grey." — Théoden (under Saruman's spell)

PATCH
/v1/team/members/{member_id}/role
AuthorizationBearer <token>

In: header

Path Parameters

member_idMember Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key
team_roleTeam Role

New team role

Response Body

curl -X PATCH "https://loading/v1/team/members/497f6eca-6276-4993-bfeb-53cbbbba6f08/role" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{    "team_role": "string"  }'
{
  "created_at": "2019-08-24T14:15:22Z",
  "display_name": "string",
  "email": "string",
  "is_active": true,
  "is_admin": true,
  "last_login": "2019-08-24T14:15:22Z",
  "team_role": "string",
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}