Skip to main content
POST
/
organization
/
teamspaces
/
{teamspace_id}
/
invites
Python
from datagrid_ai import Datagrid

client = Datagrid(
    api_key="My API Key",
)
teamspace_invite = client.organization.teamspaces.invites.create(
    teamspace_id="teamspace_id",
    email="dev@stainless.com",
)
print(teamspace_invite.id)
{
  "id": "<string>",
  "email": "jsmith@example.com",
  "permissions": {
    "role": "admin",
    "agent_ids": [
      "<string>"
    ]
  },
  "accepted_at": "2023-11-07T05:31:56Z",
  "status": "pending"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

teamspace_id
string
required

The ID of the teamspace

Body

application/json

Represents a user in a teamspace

email
string<email>
required

The email address of the user to invite

permissions
object | null

The permissions to assign to the user in the teamspace

Response

201 - application/json

User invited successfully

Represents a invite for a user in a teamspace

id
string
required

The ID of the invite. Only present if the invite is pending.

email
string<email>
required

The email address of the user invited

permissions
object
required

Represents the permissions assigned to a user in a teamspace

status
enum<string>
required

Whether the user has accepted the invite

Available options:
pending,
accepted
accepted_at
string<date-time> | null

The date and time the user accepted the invite. Only present if the invite is accepted.

I