license_manager 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/README.md +1 -1
- data/docs/IntegrationsApi.md +361 -0
- data/docs/License.md +1 -1
- data/docs/SlackAuthorize.md +18 -0
- data/docs/SlackConnection.md +38 -0
- data/docs/SlackIntegration.md +20 -0
- data/docs/UpdateSlackConnection.md +18 -0
- data/lib/license_manager/api/integrations_api.rb +326 -0
- data/lib/license_manager/models/license.rb +2 -15
- data/lib/license_manager/models/slack_authorize.rb +178 -0
- data/lib/license_manager/models/slack_connection.rb +387 -0
- data/lib/license_manager/models/slack_integration.rb +207 -0
- data/lib/license_manager/models/update_slack_connection.rb +192 -0
- data/lib/license_manager/version.rb +1 -1
- data/lib/license_manager.rb +4 -0
- data/license_manager.gemspec +9 -3
- data/openapi.json +650 -7
- data/spec/api/integrations_api_spec.rb +61 -0
- data/spec/models/slack_authorize_spec.rb +36 -0
- data/spec/models/slack_connection_spec.rb +104 -0
- data/spec/models/slack_integration_spec.rb +42 -0
- data/spec/models/update_slack_connection_spec.rb +40 -0
- metadata +25 -4
data/openapi.json
CHANGED
|
@@ -2199,18 +2199,15 @@
|
|
|
2199
2199
|
"example": "2026-01-20T16:12:00.000Z"
|
|
2200
2200
|
},
|
|
2201
2201
|
"cancellationReason": {
|
|
2202
|
-
"
|
|
2202
|
+
"anyOf": [
|
|
2203
2203
|
{
|
|
2204
2204
|
"$ref": "#/components/schemas/CancellationReason"
|
|
2205
2205
|
},
|
|
2206
2206
|
{
|
|
2207
|
-
"type":
|
|
2208
|
-
"string",
|
|
2209
|
-
"null"
|
|
2210
|
-
],
|
|
2211
|
-
"description": "Why the license was canceled. `null` when it wasn't."
|
|
2207
|
+
"type": "null"
|
|
2212
2208
|
}
|
|
2213
|
-
]
|
|
2209
|
+
],
|
|
2210
|
+
"description": "Why the license was canceled. `null` when it wasn't."
|
|
2214
2211
|
},
|
|
2215
2212
|
"subscription": {
|
|
2216
2213
|
"$ref": "#/components/schemas/LicenseSubscription"
|
|
@@ -3930,6 +3927,154 @@
|
|
|
3930
3927
|
"required": [
|
|
3931
3928
|
"policyId"
|
|
3932
3929
|
]
|
|
3930
|
+
},
|
|
3931
|
+
"SlackIntegration": {
|
|
3932
|
+
"type": "object",
|
|
3933
|
+
"properties": {
|
|
3934
|
+
"configured": {
|
|
3935
|
+
"type": "boolean",
|
|
3936
|
+
"description": "Whether the server has a Slack app to connect channels with: `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` are set."
|
|
3937
|
+
},
|
|
3938
|
+
"connections": {
|
|
3939
|
+
"type": "array",
|
|
3940
|
+
"items": {
|
|
3941
|
+
"$ref": "#/components/schemas/SlackConnection"
|
|
3942
|
+
},
|
|
3943
|
+
"description": "Slack channels getting the product's notifications."
|
|
3944
|
+
}
|
|
3945
|
+
},
|
|
3946
|
+
"required": [
|
|
3947
|
+
"configured",
|
|
3948
|
+
"connections"
|
|
3949
|
+
]
|
|
3950
|
+
},
|
|
3951
|
+
"SlackConnection": {
|
|
3952
|
+
"type": "object",
|
|
3953
|
+
"properties": {
|
|
3954
|
+
"id": {
|
|
3955
|
+
"type": "string",
|
|
3956
|
+
"example": "s4Hq8ZpLm"
|
|
3957
|
+
},
|
|
3958
|
+
"teamId": {
|
|
3959
|
+
"type": "string",
|
|
3960
|
+
"example": "T0123ABCD"
|
|
3961
|
+
},
|
|
3962
|
+
"teamName": {
|
|
3963
|
+
"type": [
|
|
3964
|
+
"string",
|
|
3965
|
+
"null"
|
|
3966
|
+
],
|
|
3967
|
+
"example": "Acme"
|
|
3968
|
+
},
|
|
3969
|
+
"channelId": {
|
|
3970
|
+
"type": "string",
|
|
3971
|
+
"example": "C0456EFGH"
|
|
3972
|
+
},
|
|
3973
|
+
"channelName": {
|
|
3974
|
+
"type": [
|
|
3975
|
+
"string",
|
|
3976
|
+
"null"
|
|
3977
|
+
],
|
|
3978
|
+
"description": "Name of the channel when it was connected, with its `#`.",
|
|
3979
|
+
"example": "#sales"
|
|
3980
|
+
},
|
|
3981
|
+
"configurationUrl": {
|
|
3982
|
+
"type": [
|
|
3983
|
+
"string",
|
|
3984
|
+
"null"
|
|
3985
|
+
],
|
|
3986
|
+
"description": "Page of the installation in Slack."
|
|
3987
|
+
},
|
|
3988
|
+
"events": {
|
|
3989
|
+
"type": "array",
|
|
3990
|
+
"items": {
|
|
3991
|
+
"type": "string",
|
|
3992
|
+
"enum": [
|
|
3993
|
+
"purchased",
|
|
3994
|
+
"renewed",
|
|
3995
|
+
"payment_failed",
|
|
3996
|
+
"canceled"
|
|
3997
|
+
]
|
|
3998
|
+
},
|
|
3999
|
+
"description": "Notifications the channel gets: `purchased` (a license bought through Stripe), `renewed` (a subscription renewal paid), `payment_failed` (a subscription payment failed) and `canceled` (a license canceled, or its subscription ended)."
|
|
4000
|
+
},
|
|
4001
|
+
"status": {
|
|
4002
|
+
"type": "string",
|
|
4003
|
+
"enum": [
|
|
4004
|
+
"active",
|
|
4005
|
+
"revoked"
|
|
4006
|
+
],
|
|
4007
|
+
"description": "`revoked` once Slack refuses the messages, like when the app was removed from the workspace or the channel deleted: remove it and add it again."
|
|
4008
|
+
},
|
|
4009
|
+
"statusReason": {
|
|
4010
|
+
"type": [
|
|
4011
|
+
"string",
|
|
4012
|
+
"null"
|
|
4013
|
+
]
|
|
4014
|
+
},
|
|
4015
|
+
"lastSentAt": {
|
|
4016
|
+
"type": [
|
|
4017
|
+
"string",
|
|
4018
|
+
"null"
|
|
4019
|
+
],
|
|
4020
|
+
"format": "date-time"
|
|
4021
|
+
},
|
|
4022
|
+
"createdAt": {
|
|
4023
|
+
"type": "string",
|
|
4024
|
+
"format": "date-time"
|
|
4025
|
+
}
|
|
4026
|
+
},
|
|
4027
|
+
"required": [
|
|
4028
|
+
"id",
|
|
4029
|
+
"teamId",
|
|
4030
|
+
"teamName",
|
|
4031
|
+
"channelId",
|
|
4032
|
+
"channelName",
|
|
4033
|
+
"configurationUrl",
|
|
4034
|
+
"events",
|
|
4035
|
+
"status",
|
|
4036
|
+
"statusReason",
|
|
4037
|
+
"lastSentAt",
|
|
4038
|
+
"createdAt"
|
|
4039
|
+
]
|
|
4040
|
+
},
|
|
4041
|
+
"SlackAuthorize": {
|
|
4042
|
+
"type": "object",
|
|
4043
|
+
"properties": {
|
|
4044
|
+
"url": {
|
|
4045
|
+
"type": "string",
|
|
4046
|
+
"description": "Slack's consent screen: open it in the browser to pick the channel. Valid 10 minutes.",
|
|
4047
|
+
"example": "https://slack.com/oauth/v2/authorize?client_id=…"
|
|
4048
|
+
}
|
|
4049
|
+
},
|
|
4050
|
+
"required": [
|
|
4051
|
+
"url"
|
|
4052
|
+
]
|
|
4053
|
+
},
|
|
4054
|
+
"UpdateSlackConnection": {
|
|
4055
|
+
"type": "object",
|
|
4056
|
+
"properties": {
|
|
4057
|
+
"events": {
|
|
4058
|
+
"type": "array",
|
|
4059
|
+
"items": {
|
|
4060
|
+
"type": "string",
|
|
4061
|
+
"enum": [
|
|
4062
|
+
"purchased",
|
|
4063
|
+
"renewed",
|
|
4064
|
+
"payment_failed",
|
|
4065
|
+
"canceled"
|
|
4066
|
+
]
|
|
4067
|
+
},
|
|
4068
|
+
"description": "Notifications the channel gets.",
|
|
4069
|
+
"example": [
|
|
4070
|
+
"purchased",
|
|
4071
|
+
"canceled"
|
|
4072
|
+
]
|
|
4073
|
+
}
|
|
4074
|
+
},
|
|
4075
|
+
"required": [
|
|
4076
|
+
"events"
|
|
4077
|
+
]
|
|
3933
4078
|
}
|
|
3934
4079
|
},
|
|
3935
4080
|
"parameters": {}
|
|
@@ -10938,6 +11083,504 @@
|
|
|
10938
11083
|
}
|
|
10939
11084
|
}
|
|
10940
11085
|
}
|
|
11086
|
+
},
|
|
11087
|
+
"/v1/products/{productId}/integrations/slack": {
|
|
11088
|
+
"get": {
|
|
11089
|
+
"tags": [
|
|
11090
|
+
"Integrations"
|
|
11091
|
+
],
|
|
11092
|
+
"operationId": "getSlackIntegration",
|
|
11093
|
+
"summary": "Get the Slack integration of a product",
|
|
11094
|
+
"description": "Slack channels getting notifications about the product's licenses: purchases, renewals, failed payments and cancellations. Doesn't accept tokens: only API keys and sessions.",
|
|
11095
|
+
"parameters": [
|
|
11096
|
+
{
|
|
11097
|
+
"schema": {
|
|
11098
|
+
"type": "string",
|
|
11099
|
+
"example": "x7Kp2QaZ"
|
|
11100
|
+
},
|
|
11101
|
+
"required": true,
|
|
11102
|
+
"name": "productId",
|
|
11103
|
+
"in": "path"
|
|
11104
|
+
}
|
|
11105
|
+
],
|
|
11106
|
+
"responses": {
|
|
11107
|
+
"200": {
|
|
11108
|
+
"description": "Slack integration",
|
|
11109
|
+
"content": {
|
|
11110
|
+
"application/json": {
|
|
11111
|
+
"schema": {
|
|
11112
|
+
"$ref": "#/components/schemas/SlackIntegration"
|
|
11113
|
+
}
|
|
11114
|
+
}
|
|
11115
|
+
}
|
|
11116
|
+
},
|
|
11117
|
+
"401": {
|
|
11118
|
+
"description": "`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted",
|
|
11119
|
+
"content": {
|
|
11120
|
+
"application/json": {
|
|
11121
|
+
"schema": {
|
|
11122
|
+
"$ref": "#/components/schemas/Error"
|
|
11123
|
+
}
|
|
11124
|
+
}
|
|
11125
|
+
}
|
|
11126
|
+
},
|
|
11127
|
+
"402": {
|
|
11128
|
+
"description": "`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit",
|
|
11129
|
+
"content": {
|
|
11130
|
+
"application/json": {
|
|
11131
|
+
"schema": {
|
|
11132
|
+
"$ref": "#/components/schemas/Error"
|
|
11133
|
+
}
|
|
11134
|
+
}
|
|
11135
|
+
}
|
|
11136
|
+
},
|
|
11137
|
+
"403": {
|
|
11138
|
+
"description": "`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested",
|
|
11139
|
+
"content": {
|
|
11140
|
+
"application/json": {
|
|
11141
|
+
"schema": {
|
|
11142
|
+
"$ref": "#/components/schemas/Error"
|
|
11143
|
+
}
|
|
11144
|
+
}
|
|
11145
|
+
}
|
|
11146
|
+
},
|
|
11147
|
+
"404": {
|
|
11148
|
+
"description": "Product not found",
|
|
11149
|
+
"content": {
|
|
11150
|
+
"application/json": {
|
|
11151
|
+
"schema": {
|
|
11152
|
+
"$ref": "#/components/schemas/Error"
|
|
11153
|
+
}
|
|
11154
|
+
}
|
|
11155
|
+
}
|
|
11156
|
+
},
|
|
11157
|
+
"422": {
|
|
11158
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11159
|
+
"content": {
|
|
11160
|
+
"application/json": {
|
|
11161
|
+
"schema": {
|
|
11162
|
+
"$ref": "#/components/schemas/Error"
|
|
11163
|
+
}
|
|
11164
|
+
}
|
|
11165
|
+
}
|
|
11166
|
+
},
|
|
11167
|
+
"429": {
|
|
11168
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11169
|
+
"content": {
|
|
11170
|
+
"application/json": {
|
|
11171
|
+
"schema": {
|
|
11172
|
+
"$ref": "#/components/schemas/Error"
|
|
11173
|
+
}
|
|
11174
|
+
}
|
|
11175
|
+
}
|
|
11176
|
+
}
|
|
11177
|
+
}
|
|
11178
|
+
}
|
|
11179
|
+
},
|
|
11180
|
+
"/v1/products/{productId}/integrations/slack/authorize": {
|
|
11181
|
+
"post": {
|
|
11182
|
+
"tags": [
|
|
11183
|
+
"Integrations"
|
|
11184
|
+
],
|
|
11185
|
+
"operationId": "authorizeSlack",
|
|
11186
|
+
"summary": "Start connecting a Slack channel",
|
|
11187
|
+
"description": "Returns the URL of Slack's consent screen, where the user picks the channel getting the product's notifications. Slack then redirects to the app's integrations page. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:create` when called with a session, granted by the member's role. API keys aren't limited by roles.",
|
|
11188
|
+
"x-required-permissions": [
|
|
11189
|
+
"integration:create"
|
|
11190
|
+
],
|
|
11191
|
+
"parameters": [
|
|
11192
|
+
{
|
|
11193
|
+
"schema": {
|
|
11194
|
+
"type": "string",
|
|
11195
|
+
"example": "x7Kp2QaZ"
|
|
11196
|
+
},
|
|
11197
|
+
"required": true,
|
|
11198
|
+
"name": "productId",
|
|
11199
|
+
"in": "path"
|
|
11200
|
+
}
|
|
11201
|
+
],
|
|
11202
|
+
"responses": {
|
|
11203
|
+
"200": {
|
|
11204
|
+
"description": "Consent screen",
|
|
11205
|
+
"content": {
|
|
11206
|
+
"application/json": {
|
|
11207
|
+
"schema": {
|
|
11208
|
+
"$ref": "#/components/schemas/SlackAuthorize"
|
|
11209
|
+
}
|
|
11210
|
+
}
|
|
11211
|
+
}
|
|
11212
|
+
},
|
|
11213
|
+
"401": {
|
|
11214
|
+
"description": "`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted",
|
|
11215
|
+
"content": {
|
|
11216
|
+
"application/json": {
|
|
11217
|
+
"schema": {
|
|
11218
|
+
"$ref": "#/components/schemas/Error"
|
|
11219
|
+
}
|
|
11220
|
+
}
|
|
11221
|
+
}
|
|
11222
|
+
},
|
|
11223
|
+
"402": {
|
|
11224
|
+
"description": "`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit",
|
|
11225
|
+
"content": {
|
|
11226
|
+
"application/json": {
|
|
11227
|
+
"schema": {
|
|
11228
|
+
"$ref": "#/components/schemas/Error"
|
|
11229
|
+
}
|
|
11230
|
+
}
|
|
11231
|
+
}
|
|
11232
|
+
},
|
|
11233
|
+
"403": {
|
|
11234
|
+
"description": "`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested",
|
|
11235
|
+
"content": {
|
|
11236
|
+
"application/json": {
|
|
11237
|
+
"schema": {
|
|
11238
|
+
"$ref": "#/components/schemas/Error"
|
|
11239
|
+
}
|
|
11240
|
+
}
|
|
11241
|
+
}
|
|
11242
|
+
},
|
|
11243
|
+
"404": {
|
|
11244
|
+
"description": "Product not found",
|
|
11245
|
+
"content": {
|
|
11246
|
+
"application/json": {
|
|
11247
|
+
"schema": {
|
|
11248
|
+
"$ref": "#/components/schemas/Error"
|
|
11249
|
+
}
|
|
11250
|
+
}
|
|
11251
|
+
}
|
|
11252
|
+
},
|
|
11253
|
+
"409": {
|
|
11254
|
+
"description": "`slack_not_configured`: the server has no Slack app (`SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET`)",
|
|
11255
|
+
"content": {
|
|
11256
|
+
"application/json": {
|
|
11257
|
+
"schema": {
|
|
11258
|
+
"$ref": "#/components/schemas/Error"
|
|
11259
|
+
}
|
|
11260
|
+
}
|
|
11261
|
+
}
|
|
11262
|
+
},
|
|
11263
|
+
"422": {
|
|
11264
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11265
|
+
"content": {
|
|
11266
|
+
"application/json": {
|
|
11267
|
+
"schema": {
|
|
11268
|
+
"$ref": "#/components/schemas/Error"
|
|
11269
|
+
}
|
|
11270
|
+
}
|
|
11271
|
+
}
|
|
11272
|
+
},
|
|
11273
|
+
"429": {
|
|
11274
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11275
|
+
"content": {
|
|
11276
|
+
"application/json": {
|
|
11277
|
+
"schema": {
|
|
11278
|
+
"$ref": "#/components/schemas/Error"
|
|
11279
|
+
}
|
|
11280
|
+
}
|
|
11281
|
+
}
|
|
11282
|
+
}
|
|
11283
|
+
}
|
|
11284
|
+
}
|
|
11285
|
+
},
|
|
11286
|
+
"/v1/slack-connections/{id}": {
|
|
11287
|
+
"patch": {
|
|
11288
|
+
"tags": [
|
|
11289
|
+
"Integrations"
|
|
11290
|
+
],
|
|
11291
|
+
"operationId": "updateSlackConnection",
|
|
11292
|
+
"summary": "Update a Slack connection",
|
|
11293
|
+
"description": "Changes the notifications the channel gets. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.",
|
|
11294
|
+
"x-required-permissions": [
|
|
11295
|
+
"integration:update"
|
|
11296
|
+
],
|
|
11297
|
+
"parameters": [
|
|
11298
|
+
{
|
|
11299
|
+
"schema": {
|
|
11300
|
+
"type": "string",
|
|
11301
|
+
"example": "s4Hq8ZpLm"
|
|
11302
|
+
},
|
|
11303
|
+
"required": true,
|
|
11304
|
+
"name": "id",
|
|
11305
|
+
"in": "path"
|
|
11306
|
+
}
|
|
11307
|
+
],
|
|
11308
|
+
"requestBody": {
|
|
11309
|
+
"required": true,
|
|
11310
|
+
"content": {
|
|
11311
|
+
"application/json": {
|
|
11312
|
+
"schema": {
|
|
11313
|
+
"$ref": "#/components/schemas/UpdateSlackConnection"
|
|
11314
|
+
}
|
|
11315
|
+
}
|
|
11316
|
+
}
|
|
11317
|
+
},
|
|
11318
|
+
"responses": {
|
|
11319
|
+
"200": {
|
|
11320
|
+
"description": "Updated Slack connection",
|
|
11321
|
+
"content": {
|
|
11322
|
+
"application/json": {
|
|
11323
|
+
"schema": {
|
|
11324
|
+
"$ref": "#/components/schemas/SlackConnection"
|
|
11325
|
+
}
|
|
11326
|
+
}
|
|
11327
|
+
}
|
|
11328
|
+
},
|
|
11329
|
+
"401": {
|
|
11330
|
+
"description": "`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted",
|
|
11331
|
+
"content": {
|
|
11332
|
+
"application/json": {
|
|
11333
|
+
"schema": {
|
|
11334
|
+
"$ref": "#/components/schemas/Error"
|
|
11335
|
+
}
|
|
11336
|
+
}
|
|
11337
|
+
}
|
|
11338
|
+
},
|
|
11339
|
+
"402": {
|
|
11340
|
+
"description": "`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit",
|
|
11341
|
+
"content": {
|
|
11342
|
+
"application/json": {
|
|
11343
|
+
"schema": {
|
|
11344
|
+
"$ref": "#/components/schemas/Error"
|
|
11345
|
+
}
|
|
11346
|
+
}
|
|
11347
|
+
}
|
|
11348
|
+
},
|
|
11349
|
+
"403": {
|
|
11350
|
+
"description": "`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested",
|
|
11351
|
+
"content": {
|
|
11352
|
+
"application/json": {
|
|
11353
|
+
"schema": {
|
|
11354
|
+
"$ref": "#/components/schemas/Error"
|
|
11355
|
+
}
|
|
11356
|
+
}
|
|
11357
|
+
}
|
|
11358
|
+
},
|
|
11359
|
+
"404": {
|
|
11360
|
+
"description": "Slack connection not found",
|
|
11361
|
+
"content": {
|
|
11362
|
+
"application/json": {
|
|
11363
|
+
"schema": {
|
|
11364
|
+
"$ref": "#/components/schemas/Error"
|
|
11365
|
+
}
|
|
11366
|
+
}
|
|
11367
|
+
}
|
|
11368
|
+
},
|
|
11369
|
+
"422": {
|
|
11370
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11371
|
+
"content": {
|
|
11372
|
+
"application/json": {
|
|
11373
|
+
"schema": {
|
|
11374
|
+
"$ref": "#/components/schemas/Error"
|
|
11375
|
+
}
|
|
11376
|
+
}
|
|
11377
|
+
}
|
|
11378
|
+
},
|
|
11379
|
+
"429": {
|
|
11380
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11381
|
+
"content": {
|
|
11382
|
+
"application/json": {
|
|
11383
|
+
"schema": {
|
|
11384
|
+
"$ref": "#/components/schemas/Error"
|
|
11385
|
+
}
|
|
11386
|
+
}
|
|
11387
|
+
}
|
|
11388
|
+
}
|
|
11389
|
+
}
|
|
11390
|
+
},
|
|
11391
|
+
"delete": {
|
|
11392
|
+
"tags": [
|
|
11393
|
+
"Integrations"
|
|
11394
|
+
],
|
|
11395
|
+
"operationId": "deleteSlackConnection",
|
|
11396
|
+
"summary": "Remove a Slack connection",
|
|
11397
|
+
"description": "Stops posting to the channel and revokes the installation's token in Slack. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.",
|
|
11398
|
+
"x-required-permissions": [
|
|
11399
|
+
"integration:delete"
|
|
11400
|
+
],
|
|
11401
|
+
"parameters": [
|
|
11402
|
+
{
|
|
11403
|
+
"schema": {
|
|
11404
|
+
"type": "string",
|
|
11405
|
+
"example": "s4Hq8ZpLm"
|
|
11406
|
+
},
|
|
11407
|
+
"required": true,
|
|
11408
|
+
"name": "id",
|
|
11409
|
+
"in": "path"
|
|
11410
|
+
}
|
|
11411
|
+
],
|
|
11412
|
+
"responses": {
|
|
11413
|
+
"204": {
|
|
11414
|
+
"description": "Removed"
|
|
11415
|
+
},
|
|
11416
|
+
"401": {
|
|
11417
|
+
"description": "`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted",
|
|
11418
|
+
"content": {
|
|
11419
|
+
"application/json": {
|
|
11420
|
+
"schema": {
|
|
11421
|
+
"$ref": "#/components/schemas/Error"
|
|
11422
|
+
}
|
|
11423
|
+
}
|
|
11424
|
+
}
|
|
11425
|
+
},
|
|
11426
|
+
"402": {
|
|
11427
|
+
"description": "`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit",
|
|
11428
|
+
"content": {
|
|
11429
|
+
"application/json": {
|
|
11430
|
+
"schema": {
|
|
11431
|
+
"$ref": "#/components/schemas/Error"
|
|
11432
|
+
}
|
|
11433
|
+
}
|
|
11434
|
+
}
|
|
11435
|
+
},
|
|
11436
|
+
"403": {
|
|
11437
|
+
"description": "`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested",
|
|
11438
|
+
"content": {
|
|
11439
|
+
"application/json": {
|
|
11440
|
+
"schema": {
|
|
11441
|
+
"$ref": "#/components/schemas/Error"
|
|
11442
|
+
}
|
|
11443
|
+
}
|
|
11444
|
+
}
|
|
11445
|
+
},
|
|
11446
|
+
"404": {
|
|
11447
|
+
"description": "Slack connection not found",
|
|
11448
|
+
"content": {
|
|
11449
|
+
"application/json": {
|
|
11450
|
+
"schema": {
|
|
11451
|
+
"$ref": "#/components/schemas/Error"
|
|
11452
|
+
}
|
|
11453
|
+
}
|
|
11454
|
+
}
|
|
11455
|
+
},
|
|
11456
|
+
"422": {
|
|
11457
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11458
|
+
"content": {
|
|
11459
|
+
"application/json": {
|
|
11460
|
+
"schema": {
|
|
11461
|
+
"$ref": "#/components/schemas/Error"
|
|
11462
|
+
}
|
|
11463
|
+
}
|
|
11464
|
+
}
|
|
11465
|
+
},
|
|
11466
|
+
"429": {
|
|
11467
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11468
|
+
"content": {
|
|
11469
|
+
"application/json": {
|
|
11470
|
+
"schema": {
|
|
11471
|
+
"$ref": "#/components/schemas/Error"
|
|
11472
|
+
}
|
|
11473
|
+
}
|
|
11474
|
+
}
|
|
11475
|
+
}
|
|
11476
|
+
}
|
|
11477
|
+
}
|
|
11478
|
+
},
|
|
11479
|
+
"/v1/slack-connections/{id}/test": {
|
|
11480
|
+
"post": {
|
|
11481
|
+
"tags": [
|
|
11482
|
+
"Integrations"
|
|
11483
|
+
],
|
|
11484
|
+
"operationId": "testSlackConnection",
|
|
11485
|
+
"summary": "Send a test message to a Slack channel",
|
|
11486
|
+
"description": "Posts a message to the channel, to check it gets the notifications. Marks the connection `revoked` when Slack says it won't work again. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.",
|
|
11487
|
+
"x-required-permissions": [
|
|
11488
|
+
"integration:update"
|
|
11489
|
+
],
|
|
11490
|
+
"parameters": [
|
|
11491
|
+
{
|
|
11492
|
+
"schema": {
|
|
11493
|
+
"type": "string",
|
|
11494
|
+
"example": "s4Hq8ZpLm"
|
|
11495
|
+
},
|
|
11496
|
+
"required": true,
|
|
11497
|
+
"name": "id",
|
|
11498
|
+
"in": "path"
|
|
11499
|
+
}
|
|
11500
|
+
],
|
|
11501
|
+
"responses": {
|
|
11502
|
+
"200": {
|
|
11503
|
+
"description": "Slack connection, after the test",
|
|
11504
|
+
"content": {
|
|
11505
|
+
"application/json": {
|
|
11506
|
+
"schema": {
|
|
11507
|
+
"$ref": "#/components/schemas/SlackConnection"
|
|
11508
|
+
}
|
|
11509
|
+
}
|
|
11510
|
+
}
|
|
11511
|
+
},
|
|
11512
|
+
"401": {
|
|
11513
|
+
"description": "`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted",
|
|
11514
|
+
"content": {
|
|
11515
|
+
"application/json": {
|
|
11516
|
+
"schema": {
|
|
11517
|
+
"$ref": "#/components/schemas/Error"
|
|
11518
|
+
}
|
|
11519
|
+
}
|
|
11520
|
+
}
|
|
11521
|
+
},
|
|
11522
|
+
"402": {
|
|
11523
|
+
"description": "`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit",
|
|
11524
|
+
"content": {
|
|
11525
|
+
"application/json": {
|
|
11526
|
+
"schema": {
|
|
11527
|
+
"$ref": "#/components/schemas/Error"
|
|
11528
|
+
}
|
|
11529
|
+
}
|
|
11530
|
+
}
|
|
11531
|
+
},
|
|
11532
|
+
"403": {
|
|
11533
|
+
"description": "`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested",
|
|
11534
|
+
"content": {
|
|
11535
|
+
"application/json": {
|
|
11536
|
+
"schema": {
|
|
11537
|
+
"$ref": "#/components/schemas/Error"
|
|
11538
|
+
}
|
|
11539
|
+
}
|
|
11540
|
+
}
|
|
11541
|
+
},
|
|
11542
|
+
"404": {
|
|
11543
|
+
"description": "Slack connection not found",
|
|
11544
|
+
"content": {
|
|
11545
|
+
"application/json": {
|
|
11546
|
+
"schema": {
|
|
11547
|
+
"$ref": "#/components/schemas/Error"
|
|
11548
|
+
}
|
|
11549
|
+
}
|
|
11550
|
+
}
|
|
11551
|
+
},
|
|
11552
|
+
"422": {
|
|
11553
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11554
|
+
"content": {
|
|
11555
|
+
"application/json": {
|
|
11556
|
+
"schema": {
|
|
11557
|
+
"$ref": "#/components/schemas/Error"
|
|
11558
|
+
}
|
|
11559
|
+
}
|
|
11560
|
+
}
|
|
11561
|
+
},
|
|
11562
|
+
"429": {
|
|
11563
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11564
|
+
"content": {
|
|
11565
|
+
"application/json": {
|
|
11566
|
+
"schema": {
|
|
11567
|
+
"$ref": "#/components/schemas/Error"
|
|
11568
|
+
}
|
|
11569
|
+
}
|
|
11570
|
+
}
|
|
11571
|
+
},
|
|
11572
|
+
"502": {
|
|
11573
|
+
"description": "`slack_error`: Slack refused the message",
|
|
11574
|
+
"content": {
|
|
11575
|
+
"application/json": {
|
|
11576
|
+
"schema": {
|
|
11577
|
+
"$ref": "#/components/schemas/Error"
|
|
11578
|
+
}
|
|
11579
|
+
}
|
|
11580
|
+
}
|
|
11581
|
+
}
|
|
11582
|
+
}
|
|
11583
|
+
}
|
|
10941
11584
|
}
|
|
10942
11585
|
},
|
|
10943
11586
|
"webhooks": {}
|