Skip to main content

Slack Connect API

Table of Contents​

Top

upsquad/slackconnect/v1/slackconnect.proto​

ApplyRequest​

FieldTypeLabelDescription
request_idstringrequest_id is a client-supplied UUID used for idempotent retries. A second Apply with the same request_id short-circuits to the first call's result without re-running any writes.
usersApplyUserrepeatedusers is the subset of Slack users the admin selected for import.
usergroup_mappingsApplyUsergroupMappingrepeatedusergroup_mappings pins a Slack usergroup to an UpsQuad org_unit. The members of the usergroup are added as memberships of the unit.

ApplyResponse​

FieldTypeLabelDescription
members_createdint32members_created is the count of new UpsQuad members inserted by this call; members_linked is the count of Slack users that matched an existing email.
members_linkedint32
memberships_addedint32memberships_added is the count of (member, org_unit) pairs newly inserted into org_unit_memberships.
warningsstringrepeatedwarnings carries non-fatal issues (unmatched emails, skipped bots, …) so the console can surface them without failing the whole apply.

ApplyUser​

FieldTypeLabelDescription
slack_user_idstring
emailstring
display_namestring
clearanceint32clearance is the numeric tier assigned to newly-created members. Must be in [1..5]; existing members are NOT re-evaluated.

ApplyUsergroupMapping​

FieldTypeLabelDescription
slack_usergroup_idstring
org_unit_idstringorg_unit_id is the UpsQuad org_unit the Slack usergroup maps onto.
membership_rolestringmembership_role is "member"

CallbackRequest​

CallbackRequest carries the ?code and ?state returned by Slack.

FieldTypeLabelDescription
codestring
statestring

CallbackResponse​

CallbackResponse indicates success and returns the persisted integration summary.

FieldTypeLabelDescription
integrationIntegration

ConnectRequest​

ConnectRequest initiates the OAuth handshake.

FieldTypeLabelDescription
redirect_uristringredirect_uri is the console URL Slack should hand the code/state back to. MUST match one of the app's configured redirect URIs — Slack validates this server-side.

ConnectResponse​

ConnectResponse returns the Slack authorize URL.

FieldTypeLabelDescription
authorize_urlstringauthorize_url is the full https://slack.com/oauth/v2/authorize?… URL.
statestringstate is the single-use nonce (UUID) baked into the authorize URL. Callers do not need to echo it manually — Slack includes it in the redirect — but it is returned here so the console can cross-check.

DisconnectIntegrationRequest​

DisconnectIntegrationResponse​

FieldTypeLabelDescription
disconnectedbool

GetIntegrationRequest​

GetIntegrationResponse​

FieldTypeLabelDescription
integrationIntegration

Integration​

Integration is the wire form of a slack_integrations row. The bot token is NEVER returned; this message carries only the identity + status fields the console needs.

FieldTypeLabelDescription
idstring
org_idstring
slack_team_idstring
slack_team_namestring
slack_app_idstring
slack_bot_user_idstring
scopesstringrepeated
statusstringactive
last_sync_atgoogle.protobuf.Timestamp
last_sync_statusstring
created_atgoogle.protobuf.Timestamp
updated_atgoogle.protobuf.Timestamp

PreviewUsergroupsRequest​

PreviewUsergroupsResponse​

FieldTypeLabelDescription
usergroupsSlackUsergroupPreviewrepeated

PreviewUsersRequest​

FieldTypeLabelDescription
cursorstringcursor is the Slack pagination cursor from the previous page; empty on the first call.
page_sizeint32page_size clamps to [1, 200]. Defaults to 100 when 0.

PreviewUsersResponse​

FieldTypeLabelDescription
usersSlackUserPreviewrepeated
next_cursorstringnext_cursor is empty when there are no more pages.

SlackUserPreview​

SlackUserPreview is one row of the preview grid.

FieldTypeLabelDescription
slack_user_idstring
slack_team_idstring
display_namestring
real_namestring
emailstring
is_botbool
is_deletedbool
match_kindstringmatch_kind describes whether this Slack user already has a matching UpsQuad member (by email). Values: new
existing_member_idstringexisting_member_id is populated when match_kind is match

SlackUsergroupPreview​

FieldTypeLabelDescription
slack_usergroup_idstring
handlestringe.g. "engineering"
namestringhuman-readable
descriptionstring
slack_user_idsstringrepeatedmembers

SlackConnectService​

SlackConnectService drives the OAuth v2 flow + preview/apply for the single-app Slack integration.

--- OAuth flow ---

Method NameRequest TypeResponse TypeDescription
ConnectConnectRequestConnectResponseConnect mints a single-use oauth state row and returns the Slack authorize URL the console should redirect the admin to. The returned state MUST be echoed back to Callback — replays are rejected.
CallbackCallbackRequestCallbackResponseCallback exchanges an OAuth v2 authorization code for a bot token and persists the integration. Idempotent on (org_id, slack_team_id): a re-install for the same Slack workspace rotates the stored token.
GetIntegrationGetIntegrationRequestGetIntegrationResponseGetIntegration returns the current integration row for the tenant (never the raw token). Returns NOT_FOUND when no active row exists.
DisconnectIntegrationDisconnectIntegrationRequestDisconnectIntegrationResponseDisconnectIntegration soft-deletes the current integration and zeroes the vault entry. Idempotent.
PreviewUsersPreviewUsersRequestPreviewUsersResponsePreviewUsers pages through Slack users.list and returns a diff-view the console can render: whether each Slack user already has a matching UpsQuad member (by email), along with the fields we'd create/update.
PreviewUsergroupsPreviewUsergroupsRequestPreviewUsergroupsResponsePreviewUsergroups returns usergroups.list (including members) so the console can render a mapping UI for org_units.
ApplyApplyRequestApplyResponseApply takes the admin's selection of users + usergroup→org_unit mappings and creates members / memberships inside a single transaction. Members are upserted by email: existing members are linked, new members are inserted. Idempotent against the same request_id (UUID supplied by the client) — replays return the original result without side-effects.

Scalar Value Types​

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)