license_manager 0.3.0 → 0.3.2
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 +21 -0
- data/README.md +1 -1
- data/docs/IntegrationsApi.md +361 -0
- data/docs/License.md +2 -0
- data/docs/LicenseCustomer.md +22 -0
- data/docs/LicensesApi.md +4 -4
- 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/api/licenses_api.rb +4 -4
- data/lib/license_manager/models/license.rb +27 -1
- data/lib/license_manager/models/license_customer.rb +217 -0
- 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 +5 -0
- data/openapi.json +682 -4
- data/spec/api/integrations_api_spec.rb +61 -0
- data/spec/api/licenses_api_spec.rb +2 -2
- data/spec/models/license_customer_spec.rb +48 -0
- data/spec/models/license_spec.rb +6 -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 +21 -1
data/openapi.json
CHANGED
|
@@ -2103,6 +2103,9 @@
|
|
|
2103
2103
|
"type": "string",
|
|
2104
2104
|
"example": "c9Wd3RtE"
|
|
2105
2105
|
},
|
|
2106
|
+
"customer": {
|
|
2107
|
+
"$ref": "#/components/schemas/LicenseCustomer"
|
|
2108
|
+
},
|
|
2106
2109
|
"key": {
|
|
2107
2110
|
"type": "string",
|
|
2108
2111
|
"description": "Unique within the product. Case sensitive: `validateKey` compares keys exactly.",
|
|
@@ -2240,6 +2243,7 @@
|
|
|
2240
2243
|
"productId",
|
|
2241
2244
|
"policyId",
|
|
2242
2245
|
"customerId",
|
|
2246
|
+
"customer",
|
|
2243
2247
|
"key",
|
|
2244
2248
|
"createdAt",
|
|
2245
2249
|
"expiresAt",
|
|
@@ -2261,6 +2265,34 @@
|
|
|
2261
2265
|
"updatedAt"
|
|
2262
2266
|
]
|
|
2263
2267
|
},
|
|
2268
|
+
"LicenseCustomer": {
|
|
2269
|
+
"type": "object",
|
|
2270
|
+
"properties": {
|
|
2271
|
+
"id": {
|
|
2272
|
+
"type": "string",
|
|
2273
|
+
"example": "c9Wd3RtE"
|
|
2274
|
+
},
|
|
2275
|
+
"email": {
|
|
2276
|
+
"type": "string",
|
|
2277
|
+
"format": "email",
|
|
2278
|
+
"example": "jane@example.com"
|
|
2279
|
+
},
|
|
2280
|
+
"name": {
|
|
2281
|
+
"type": [
|
|
2282
|
+
"string",
|
|
2283
|
+
"null"
|
|
2284
|
+
],
|
|
2285
|
+
"description": "Display name of the customer. `null` when unknown.",
|
|
2286
|
+
"example": "Jane Doe"
|
|
2287
|
+
}
|
|
2288
|
+
},
|
|
2289
|
+
"required": [
|
|
2290
|
+
"id",
|
|
2291
|
+
"email",
|
|
2292
|
+
"name"
|
|
2293
|
+
],
|
|
2294
|
+
"description": "Customer the license belongs to, the one of `customerId`."
|
|
2295
|
+
},
|
|
2264
2296
|
"LicenseMaxVersion": {
|
|
2265
2297
|
"type": "object",
|
|
2266
2298
|
"properties": {
|
|
@@ -3898,6 +3930,154 @@
|
|
|
3898
3930
|
"required": [
|
|
3899
3931
|
"policyId"
|
|
3900
3932
|
]
|
|
3933
|
+
},
|
|
3934
|
+
"SlackIntegration": {
|
|
3935
|
+
"type": "object",
|
|
3936
|
+
"properties": {
|
|
3937
|
+
"configured": {
|
|
3938
|
+
"type": "boolean",
|
|
3939
|
+
"description": "Whether the server has a Slack app to connect channels with: `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` are set."
|
|
3940
|
+
},
|
|
3941
|
+
"connections": {
|
|
3942
|
+
"type": "array",
|
|
3943
|
+
"items": {
|
|
3944
|
+
"$ref": "#/components/schemas/SlackConnection"
|
|
3945
|
+
},
|
|
3946
|
+
"description": "Slack channels getting the product's notifications."
|
|
3947
|
+
}
|
|
3948
|
+
},
|
|
3949
|
+
"required": [
|
|
3950
|
+
"configured",
|
|
3951
|
+
"connections"
|
|
3952
|
+
]
|
|
3953
|
+
},
|
|
3954
|
+
"SlackConnection": {
|
|
3955
|
+
"type": "object",
|
|
3956
|
+
"properties": {
|
|
3957
|
+
"id": {
|
|
3958
|
+
"type": "string",
|
|
3959
|
+
"example": "s4Hq8ZpLm"
|
|
3960
|
+
},
|
|
3961
|
+
"teamId": {
|
|
3962
|
+
"type": "string",
|
|
3963
|
+
"example": "T0123ABCD"
|
|
3964
|
+
},
|
|
3965
|
+
"teamName": {
|
|
3966
|
+
"type": [
|
|
3967
|
+
"string",
|
|
3968
|
+
"null"
|
|
3969
|
+
],
|
|
3970
|
+
"example": "Acme"
|
|
3971
|
+
},
|
|
3972
|
+
"channelId": {
|
|
3973
|
+
"type": "string",
|
|
3974
|
+
"example": "C0456EFGH"
|
|
3975
|
+
},
|
|
3976
|
+
"channelName": {
|
|
3977
|
+
"type": [
|
|
3978
|
+
"string",
|
|
3979
|
+
"null"
|
|
3980
|
+
],
|
|
3981
|
+
"description": "Name of the channel when it was connected, with its `#`.",
|
|
3982
|
+
"example": "#sales"
|
|
3983
|
+
},
|
|
3984
|
+
"configurationUrl": {
|
|
3985
|
+
"type": [
|
|
3986
|
+
"string",
|
|
3987
|
+
"null"
|
|
3988
|
+
],
|
|
3989
|
+
"description": "Page of the installation in Slack."
|
|
3990
|
+
},
|
|
3991
|
+
"events": {
|
|
3992
|
+
"type": "array",
|
|
3993
|
+
"items": {
|
|
3994
|
+
"type": "string",
|
|
3995
|
+
"enum": [
|
|
3996
|
+
"purchased",
|
|
3997
|
+
"renewed",
|
|
3998
|
+
"payment_failed",
|
|
3999
|
+
"canceled"
|
|
4000
|
+
]
|
|
4001
|
+
},
|
|
4002
|
+
"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)."
|
|
4003
|
+
},
|
|
4004
|
+
"status": {
|
|
4005
|
+
"type": "string",
|
|
4006
|
+
"enum": [
|
|
4007
|
+
"active",
|
|
4008
|
+
"revoked"
|
|
4009
|
+
],
|
|
4010
|
+
"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."
|
|
4011
|
+
},
|
|
4012
|
+
"statusReason": {
|
|
4013
|
+
"type": [
|
|
4014
|
+
"string",
|
|
4015
|
+
"null"
|
|
4016
|
+
]
|
|
4017
|
+
},
|
|
4018
|
+
"lastSentAt": {
|
|
4019
|
+
"type": [
|
|
4020
|
+
"string",
|
|
4021
|
+
"null"
|
|
4022
|
+
],
|
|
4023
|
+
"format": "date-time"
|
|
4024
|
+
},
|
|
4025
|
+
"createdAt": {
|
|
4026
|
+
"type": "string",
|
|
4027
|
+
"format": "date-time"
|
|
4028
|
+
}
|
|
4029
|
+
},
|
|
4030
|
+
"required": [
|
|
4031
|
+
"id",
|
|
4032
|
+
"teamId",
|
|
4033
|
+
"teamName",
|
|
4034
|
+
"channelId",
|
|
4035
|
+
"channelName",
|
|
4036
|
+
"configurationUrl",
|
|
4037
|
+
"events",
|
|
4038
|
+
"status",
|
|
4039
|
+
"statusReason",
|
|
4040
|
+
"lastSentAt",
|
|
4041
|
+
"createdAt"
|
|
4042
|
+
]
|
|
4043
|
+
},
|
|
4044
|
+
"SlackAuthorize": {
|
|
4045
|
+
"type": "object",
|
|
4046
|
+
"properties": {
|
|
4047
|
+
"url": {
|
|
4048
|
+
"type": "string",
|
|
4049
|
+
"description": "Slack's consent screen: open it in the browser to pick the channel. Valid 10 minutes.",
|
|
4050
|
+
"example": "https://slack.com/oauth/v2/authorize?client_id=…"
|
|
4051
|
+
}
|
|
4052
|
+
},
|
|
4053
|
+
"required": [
|
|
4054
|
+
"url"
|
|
4055
|
+
]
|
|
4056
|
+
},
|
|
4057
|
+
"UpdateSlackConnection": {
|
|
4058
|
+
"type": "object",
|
|
4059
|
+
"properties": {
|
|
4060
|
+
"events": {
|
|
4061
|
+
"type": "array",
|
|
4062
|
+
"items": {
|
|
4063
|
+
"type": "string",
|
|
4064
|
+
"enum": [
|
|
4065
|
+
"purchased",
|
|
4066
|
+
"renewed",
|
|
4067
|
+
"payment_failed",
|
|
4068
|
+
"canceled"
|
|
4069
|
+
]
|
|
4070
|
+
},
|
|
4071
|
+
"description": "Notifications the channel gets.",
|
|
4072
|
+
"example": [
|
|
4073
|
+
"purchased",
|
|
4074
|
+
"canceled"
|
|
4075
|
+
]
|
|
4076
|
+
}
|
|
4077
|
+
},
|
|
4078
|
+
"required": [
|
|
4079
|
+
"events"
|
|
4080
|
+
]
|
|
3901
4081
|
}
|
|
3902
4082
|
},
|
|
3903
4083
|
"parameters": {}
|
|
@@ -6402,11 +6582,11 @@
|
|
|
6402
6582
|
"type": "string",
|
|
6403
6583
|
"minLength": 1,
|
|
6404
6584
|
"maxLength": 200,
|
|
6405
|
-
"description": "Case-insensitive text the key contains.",
|
|
6585
|
+
"description": "Case-insensitive text the key or the email of the customer contains.",
|
|
6406
6586
|
"example": "X9ZPA"
|
|
6407
6587
|
},
|
|
6408
6588
|
"required": false,
|
|
6409
|
-
"description": "Case-insensitive text the key contains.",
|
|
6589
|
+
"description": "Case-insensitive text the key or the email of the customer contains.",
|
|
6410
6590
|
"name": "search",
|
|
6411
6591
|
"in": "query"
|
|
6412
6592
|
},
|
|
@@ -6914,11 +7094,11 @@
|
|
|
6914
7094
|
"type": "string",
|
|
6915
7095
|
"minLength": 1,
|
|
6916
7096
|
"maxLength": 200,
|
|
6917
|
-
"description": "Case-insensitive text the key contains.",
|
|
7097
|
+
"description": "Case-insensitive text the key or the email of the customer contains.",
|
|
6918
7098
|
"example": "X9ZPA"
|
|
6919
7099
|
},
|
|
6920
7100
|
"required": false,
|
|
6921
|
-
"description": "Case-insensitive text the key contains.",
|
|
7101
|
+
"description": "Case-insensitive text the key or the email of the customer contains.",
|
|
6922
7102
|
"name": "search",
|
|
6923
7103
|
"in": "query"
|
|
6924
7104
|
},
|
|
@@ -10906,6 +11086,504 @@
|
|
|
10906
11086
|
}
|
|
10907
11087
|
}
|
|
10908
11088
|
}
|
|
11089
|
+
},
|
|
11090
|
+
"/v1/products/{productId}/integrations/slack": {
|
|
11091
|
+
"get": {
|
|
11092
|
+
"tags": [
|
|
11093
|
+
"Integrations"
|
|
11094
|
+
],
|
|
11095
|
+
"operationId": "getSlackIntegration",
|
|
11096
|
+
"summary": "Get the Slack integration of a product",
|
|
11097
|
+
"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.",
|
|
11098
|
+
"parameters": [
|
|
11099
|
+
{
|
|
11100
|
+
"schema": {
|
|
11101
|
+
"type": "string",
|
|
11102
|
+
"example": "x7Kp2QaZ"
|
|
11103
|
+
},
|
|
11104
|
+
"required": true,
|
|
11105
|
+
"name": "productId",
|
|
11106
|
+
"in": "path"
|
|
11107
|
+
}
|
|
11108
|
+
],
|
|
11109
|
+
"responses": {
|
|
11110
|
+
"200": {
|
|
11111
|
+
"description": "Slack integration",
|
|
11112
|
+
"content": {
|
|
11113
|
+
"application/json": {
|
|
11114
|
+
"schema": {
|
|
11115
|
+
"$ref": "#/components/schemas/SlackIntegration"
|
|
11116
|
+
}
|
|
11117
|
+
}
|
|
11118
|
+
}
|
|
11119
|
+
},
|
|
11120
|
+
"401": {
|
|
11121
|
+
"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",
|
|
11122
|
+
"content": {
|
|
11123
|
+
"application/json": {
|
|
11124
|
+
"schema": {
|
|
11125
|
+
"$ref": "#/components/schemas/Error"
|
|
11126
|
+
}
|
|
11127
|
+
}
|
|
11128
|
+
}
|
|
11129
|
+
},
|
|
11130
|
+
"402": {
|
|
11131
|
+
"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",
|
|
11132
|
+
"content": {
|
|
11133
|
+
"application/json": {
|
|
11134
|
+
"schema": {
|
|
11135
|
+
"$ref": "#/components/schemas/Error"
|
|
11136
|
+
}
|
|
11137
|
+
}
|
|
11138
|
+
}
|
|
11139
|
+
},
|
|
11140
|
+
"403": {
|
|
11141
|
+
"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",
|
|
11142
|
+
"content": {
|
|
11143
|
+
"application/json": {
|
|
11144
|
+
"schema": {
|
|
11145
|
+
"$ref": "#/components/schemas/Error"
|
|
11146
|
+
}
|
|
11147
|
+
}
|
|
11148
|
+
}
|
|
11149
|
+
},
|
|
11150
|
+
"404": {
|
|
11151
|
+
"description": "Product not found",
|
|
11152
|
+
"content": {
|
|
11153
|
+
"application/json": {
|
|
11154
|
+
"schema": {
|
|
11155
|
+
"$ref": "#/components/schemas/Error"
|
|
11156
|
+
}
|
|
11157
|
+
}
|
|
11158
|
+
}
|
|
11159
|
+
},
|
|
11160
|
+
"422": {
|
|
11161
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11162
|
+
"content": {
|
|
11163
|
+
"application/json": {
|
|
11164
|
+
"schema": {
|
|
11165
|
+
"$ref": "#/components/schemas/Error"
|
|
11166
|
+
}
|
|
11167
|
+
}
|
|
11168
|
+
}
|
|
11169
|
+
},
|
|
11170
|
+
"429": {
|
|
11171
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11172
|
+
"content": {
|
|
11173
|
+
"application/json": {
|
|
11174
|
+
"schema": {
|
|
11175
|
+
"$ref": "#/components/schemas/Error"
|
|
11176
|
+
}
|
|
11177
|
+
}
|
|
11178
|
+
}
|
|
11179
|
+
}
|
|
11180
|
+
}
|
|
11181
|
+
}
|
|
11182
|
+
},
|
|
11183
|
+
"/v1/products/{productId}/integrations/slack/authorize": {
|
|
11184
|
+
"post": {
|
|
11185
|
+
"tags": [
|
|
11186
|
+
"Integrations"
|
|
11187
|
+
],
|
|
11188
|
+
"operationId": "authorizeSlack",
|
|
11189
|
+
"summary": "Start connecting a Slack channel",
|
|
11190
|
+
"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.",
|
|
11191
|
+
"x-required-permissions": [
|
|
11192
|
+
"integration:create"
|
|
11193
|
+
],
|
|
11194
|
+
"parameters": [
|
|
11195
|
+
{
|
|
11196
|
+
"schema": {
|
|
11197
|
+
"type": "string",
|
|
11198
|
+
"example": "x7Kp2QaZ"
|
|
11199
|
+
},
|
|
11200
|
+
"required": true,
|
|
11201
|
+
"name": "productId",
|
|
11202
|
+
"in": "path"
|
|
11203
|
+
}
|
|
11204
|
+
],
|
|
11205
|
+
"responses": {
|
|
11206
|
+
"200": {
|
|
11207
|
+
"description": "Consent screen",
|
|
11208
|
+
"content": {
|
|
11209
|
+
"application/json": {
|
|
11210
|
+
"schema": {
|
|
11211
|
+
"$ref": "#/components/schemas/SlackAuthorize"
|
|
11212
|
+
}
|
|
11213
|
+
}
|
|
11214
|
+
}
|
|
11215
|
+
},
|
|
11216
|
+
"401": {
|
|
11217
|
+
"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",
|
|
11218
|
+
"content": {
|
|
11219
|
+
"application/json": {
|
|
11220
|
+
"schema": {
|
|
11221
|
+
"$ref": "#/components/schemas/Error"
|
|
11222
|
+
}
|
|
11223
|
+
}
|
|
11224
|
+
}
|
|
11225
|
+
},
|
|
11226
|
+
"402": {
|
|
11227
|
+
"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",
|
|
11228
|
+
"content": {
|
|
11229
|
+
"application/json": {
|
|
11230
|
+
"schema": {
|
|
11231
|
+
"$ref": "#/components/schemas/Error"
|
|
11232
|
+
}
|
|
11233
|
+
}
|
|
11234
|
+
}
|
|
11235
|
+
},
|
|
11236
|
+
"403": {
|
|
11237
|
+
"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",
|
|
11238
|
+
"content": {
|
|
11239
|
+
"application/json": {
|
|
11240
|
+
"schema": {
|
|
11241
|
+
"$ref": "#/components/schemas/Error"
|
|
11242
|
+
}
|
|
11243
|
+
}
|
|
11244
|
+
}
|
|
11245
|
+
},
|
|
11246
|
+
"404": {
|
|
11247
|
+
"description": "Product not found",
|
|
11248
|
+
"content": {
|
|
11249
|
+
"application/json": {
|
|
11250
|
+
"schema": {
|
|
11251
|
+
"$ref": "#/components/schemas/Error"
|
|
11252
|
+
}
|
|
11253
|
+
}
|
|
11254
|
+
}
|
|
11255
|
+
},
|
|
11256
|
+
"409": {
|
|
11257
|
+
"description": "`slack_not_configured`: the server has no Slack app (`SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET`)",
|
|
11258
|
+
"content": {
|
|
11259
|
+
"application/json": {
|
|
11260
|
+
"schema": {
|
|
11261
|
+
"$ref": "#/components/schemas/Error"
|
|
11262
|
+
}
|
|
11263
|
+
}
|
|
11264
|
+
}
|
|
11265
|
+
},
|
|
11266
|
+
"422": {
|
|
11267
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11268
|
+
"content": {
|
|
11269
|
+
"application/json": {
|
|
11270
|
+
"schema": {
|
|
11271
|
+
"$ref": "#/components/schemas/Error"
|
|
11272
|
+
}
|
|
11273
|
+
}
|
|
11274
|
+
}
|
|
11275
|
+
},
|
|
11276
|
+
"429": {
|
|
11277
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11278
|
+
"content": {
|
|
11279
|
+
"application/json": {
|
|
11280
|
+
"schema": {
|
|
11281
|
+
"$ref": "#/components/schemas/Error"
|
|
11282
|
+
}
|
|
11283
|
+
}
|
|
11284
|
+
}
|
|
11285
|
+
}
|
|
11286
|
+
}
|
|
11287
|
+
}
|
|
11288
|
+
},
|
|
11289
|
+
"/v1/slack-connections/{id}": {
|
|
11290
|
+
"patch": {
|
|
11291
|
+
"tags": [
|
|
11292
|
+
"Integrations"
|
|
11293
|
+
],
|
|
11294
|
+
"operationId": "updateSlackConnection",
|
|
11295
|
+
"summary": "Update a Slack connection",
|
|
11296
|
+
"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.",
|
|
11297
|
+
"x-required-permissions": [
|
|
11298
|
+
"integration:update"
|
|
11299
|
+
],
|
|
11300
|
+
"parameters": [
|
|
11301
|
+
{
|
|
11302
|
+
"schema": {
|
|
11303
|
+
"type": "string",
|
|
11304
|
+
"example": "s4Hq8ZpLm"
|
|
11305
|
+
},
|
|
11306
|
+
"required": true,
|
|
11307
|
+
"name": "id",
|
|
11308
|
+
"in": "path"
|
|
11309
|
+
}
|
|
11310
|
+
],
|
|
11311
|
+
"requestBody": {
|
|
11312
|
+
"required": true,
|
|
11313
|
+
"content": {
|
|
11314
|
+
"application/json": {
|
|
11315
|
+
"schema": {
|
|
11316
|
+
"$ref": "#/components/schemas/UpdateSlackConnection"
|
|
11317
|
+
}
|
|
11318
|
+
}
|
|
11319
|
+
}
|
|
11320
|
+
},
|
|
11321
|
+
"responses": {
|
|
11322
|
+
"200": {
|
|
11323
|
+
"description": "Updated Slack connection",
|
|
11324
|
+
"content": {
|
|
11325
|
+
"application/json": {
|
|
11326
|
+
"schema": {
|
|
11327
|
+
"$ref": "#/components/schemas/SlackConnection"
|
|
11328
|
+
}
|
|
11329
|
+
}
|
|
11330
|
+
}
|
|
11331
|
+
},
|
|
11332
|
+
"401": {
|
|
11333
|
+
"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",
|
|
11334
|
+
"content": {
|
|
11335
|
+
"application/json": {
|
|
11336
|
+
"schema": {
|
|
11337
|
+
"$ref": "#/components/schemas/Error"
|
|
11338
|
+
}
|
|
11339
|
+
}
|
|
11340
|
+
}
|
|
11341
|
+
},
|
|
11342
|
+
"402": {
|
|
11343
|
+
"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",
|
|
11344
|
+
"content": {
|
|
11345
|
+
"application/json": {
|
|
11346
|
+
"schema": {
|
|
11347
|
+
"$ref": "#/components/schemas/Error"
|
|
11348
|
+
}
|
|
11349
|
+
}
|
|
11350
|
+
}
|
|
11351
|
+
},
|
|
11352
|
+
"403": {
|
|
11353
|
+
"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",
|
|
11354
|
+
"content": {
|
|
11355
|
+
"application/json": {
|
|
11356
|
+
"schema": {
|
|
11357
|
+
"$ref": "#/components/schemas/Error"
|
|
11358
|
+
}
|
|
11359
|
+
}
|
|
11360
|
+
}
|
|
11361
|
+
},
|
|
11362
|
+
"404": {
|
|
11363
|
+
"description": "Slack connection not found",
|
|
11364
|
+
"content": {
|
|
11365
|
+
"application/json": {
|
|
11366
|
+
"schema": {
|
|
11367
|
+
"$ref": "#/components/schemas/Error"
|
|
11368
|
+
}
|
|
11369
|
+
}
|
|
11370
|
+
}
|
|
11371
|
+
},
|
|
11372
|
+
"422": {
|
|
11373
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11374
|
+
"content": {
|
|
11375
|
+
"application/json": {
|
|
11376
|
+
"schema": {
|
|
11377
|
+
"$ref": "#/components/schemas/Error"
|
|
11378
|
+
}
|
|
11379
|
+
}
|
|
11380
|
+
}
|
|
11381
|
+
},
|
|
11382
|
+
"429": {
|
|
11383
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11384
|
+
"content": {
|
|
11385
|
+
"application/json": {
|
|
11386
|
+
"schema": {
|
|
11387
|
+
"$ref": "#/components/schemas/Error"
|
|
11388
|
+
}
|
|
11389
|
+
}
|
|
11390
|
+
}
|
|
11391
|
+
}
|
|
11392
|
+
}
|
|
11393
|
+
},
|
|
11394
|
+
"delete": {
|
|
11395
|
+
"tags": [
|
|
11396
|
+
"Integrations"
|
|
11397
|
+
],
|
|
11398
|
+
"operationId": "deleteSlackConnection",
|
|
11399
|
+
"summary": "Remove a Slack connection",
|
|
11400
|
+
"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.",
|
|
11401
|
+
"x-required-permissions": [
|
|
11402
|
+
"integration:delete"
|
|
11403
|
+
],
|
|
11404
|
+
"parameters": [
|
|
11405
|
+
{
|
|
11406
|
+
"schema": {
|
|
11407
|
+
"type": "string",
|
|
11408
|
+
"example": "s4Hq8ZpLm"
|
|
11409
|
+
},
|
|
11410
|
+
"required": true,
|
|
11411
|
+
"name": "id",
|
|
11412
|
+
"in": "path"
|
|
11413
|
+
}
|
|
11414
|
+
],
|
|
11415
|
+
"responses": {
|
|
11416
|
+
"204": {
|
|
11417
|
+
"description": "Removed"
|
|
11418
|
+
},
|
|
11419
|
+
"401": {
|
|
11420
|
+
"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",
|
|
11421
|
+
"content": {
|
|
11422
|
+
"application/json": {
|
|
11423
|
+
"schema": {
|
|
11424
|
+
"$ref": "#/components/schemas/Error"
|
|
11425
|
+
}
|
|
11426
|
+
}
|
|
11427
|
+
}
|
|
11428
|
+
},
|
|
11429
|
+
"402": {
|
|
11430
|
+
"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",
|
|
11431
|
+
"content": {
|
|
11432
|
+
"application/json": {
|
|
11433
|
+
"schema": {
|
|
11434
|
+
"$ref": "#/components/schemas/Error"
|
|
11435
|
+
}
|
|
11436
|
+
}
|
|
11437
|
+
}
|
|
11438
|
+
},
|
|
11439
|
+
"403": {
|
|
11440
|
+
"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",
|
|
11441
|
+
"content": {
|
|
11442
|
+
"application/json": {
|
|
11443
|
+
"schema": {
|
|
11444
|
+
"$ref": "#/components/schemas/Error"
|
|
11445
|
+
}
|
|
11446
|
+
}
|
|
11447
|
+
}
|
|
11448
|
+
},
|
|
11449
|
+
"404": {
|
|
11450
|
+
"description": "Slack connection not found",
|
|
11451
|
+
"content": {
|
|
11452
|
+
"application/json": {
|
|
11453
|
+
"schema": {
|
|
11454
|
+
"$ref": "#/components/schemas/Error"
|
|
11455
|
+
}
|
|
11456
|
+
}
|
|
11457
|
+
}
|
|
11458
|
+
},
|
|
11459
|
+
"422": {
|
|
11460
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11461
|
+
"content": {
|
|
11462
|
+
"application/json": {
|
|
11463
|
+
"schema": {
|
|
11464
|
+
"$ref": "#/components/schemas/Error"
|
|
11465
|
+
}
|
|
11466
|
+
}
|
|
11467
|
+
}
|
|
11468
|
+
},
|
|
11469
|
+
"429": {
|
|
11470
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11471
|
+
"content": {
|
|
11472
|
+
"application/json": {
|
|
11473
|
+
"schema": {
|
|
11474
|
+
"$ref": "#/components/schemas/Error"
|
|
11475
|
+
}
|
|
11476
|
+
}
|
|
11477
|
+
}
|
|
11478
|
+
}
|
|
11479
|
+
}
|
|
11480
|
+
}
|
|
11481
|
+
},
|
|
11482
|
+
"/v1/slack-connections/{id}/test": {
|
|
11483
|
+
"post": {
|
|
11484
|
+
"tags": [
|
|
11485
|
+
"Integrations"
|
|
11486
|
+
],
|
|
11487
|
+
"operationId": "testSlackConnection",
|
|
11488
|
+
"summary": "Send a test message to a Slack channel",
|
|
11489
|
+
"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.",
|
|
11490
|
+
"x-required-permissions": [
|
|
11491
|
+
"integration:update"
|
|
11492
|
+
],
|
|
11493
|
+
"parameters": [
|
|
11494
|
+
{
|
|
11495
|
+
"schema": {
|
|
11496
|
+
"type": "string",
|
|
11497
|
+
"example": "s4Hq8ZpLm"
|
|
11498
|
+
},
|
|
11499
|
+
"required": true,
|
|
11500
|
+
"name": "id",
|
|
11501
|
+
"in": "path"
|
|
11502
|
+
}
|
|
11503
|
+
],
|
|
11504
|
+
"responses": {
|
|
11505
|
+
"200": {
|
|
11506
|
+
"description": "Slack connection, after the test",
|
|
11507
|
+
"content": {
|
|
11508
|
+
"application/json": {
|
|
11509
|
+
"schema": {
|
|
11510
|
+
"$ref": "#/components/schemas/SlackConnection"
|
|
11511
|
+
}
|
|
11512
|
+
}
|
|
11513
|
+
}
|
|
11514
|
+
},
|
|
11515
|
+
"401": {
|
|
11516
|
+
"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",
|
|
11517
|
+
"content": {
|
|
11518
|
+
"application/json": {
|
|
11519
|
+
"schema": {
|
|
11520
|
+
"$ref": "#/components/schemas/Error"
|
|
11521
|
+
}
|
|
11522
|
+
}
|
|
11523
|
+
}
|
|
11524
|
+
},
|
|
11525
|
+
"402": {
|
|
11526
|
+
"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",
|
|
11527
|
+
"content": {
|
|
11528
|
+
"application/json": {
|
|
11529
|
+
"schema": {
|
|
11530
|
+
"$ref": "#/components/schemas/Error"
|
|
11531
|
+
}
|
|
11532
|
+
}
|
|
11533
|
+
}
|
|
11534
|
+
},
|
|
11535
|
+
"403": {
|
|
11536
|
+
"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",
|
|
11537
|
+
"content": {
|
|
11538
|
+
"application/json": {
|
|
11539
|
+
"schema": {
|
|
11540
|
+
"$ref": "#/components/schemas/Error"
|
|
11541
|
+
}
|
|
11542
|
+
}
|
|
11543
|
+
}
|
|
11544
|
+
},
|
|
11545
|
+
"404": {
|
|
11546
|
+
"description": "Slack connection not found",
|
|
11547
|
+
"content": {
|
|
11548
|
+
"application/json": {
|
|
11549
|
+
"schema": {
|
|
11550
|
+
"$ref": "#/components/schemas/Error"
|
|
11551
|
+
}
|
|
11552
|
+
}
|
|
11553
|
+
}
|
|
11554
|
+
},
|
|
11555
|
+
"422": {
|
|
11556
|
+
"description": "`validation_error`: invalid path, query or body, with the `issues`",
|
|
11557
|
+
"content": {
|
|
11558
|
+
"application/json": {
|
|
11559
|
+
"schema": {
|
|
11560
|
+
"$ref": "#/components/schemas/Error"
|
|
11561
|
+
}
|
|
11562
|
+
}
|
|
11563
|
+
}
|
|
11564
|
+
},
|
|
11565
|
+
"429": {
|
|
11566
|
+
"description": "`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds",
|
|
11567
|
+
"content": {
|
|
11568
|
+
"application/json": {
|
|
11569
|
+
"schema": {
|
|
11570
|
+
"$ref": "#/components/schemas/Error"
|
|
11571
|
+
}
|
|
11572
|
+
}
|
|
11573
|
+
}
|
|
11574
|
+
},
|
|
11575
|
+
"502": {
|
|
11576
|
+
"description": "`slack_error`: Slack refused the message",
|
|
11577
|
+
"content": {
|
|
11578
|
+
"application/json": {
|
|
11579
|
+
"schema": {
|
|
11580
|
+
"$ref": "#/components/schemas/Error"
|
|
11581
|
+
}
|
|
11582
|
+
}
|
|
11583
|
+
}
|
|
11584
|
+
}
|
|
11585
|
+
}
|
|
11586
|
+
}
|
|
10909
11587
|
}
|
|
10910
11588
|
},
|
|
10911
11589
|
"webhooks": {}
|