123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- {
- "get": {
- "tags": ["Projects"],
- "description": "Return a list of service hooks bound to a project.",
- "operationId": "List a Project's Service Hooks",
- "parameters": [
- {
- "name": "organization_id_or_slug",
- "in": "path",
- "description": "The id or slug of the organization the client keys belong to.",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "project_id_or_slug",
- "in": "path",
- "description": "The id or slug of the project the client keys belong to.",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "$ref": "../../components/parameters/pagination-cursor.json#/PaginationCursor"
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "type": "array",
- "items": {
- "$ref": "../../components/schemas/service-hook.json#/ServiceHook"
- }
- },
- "example": [
- {
- "dateCreated": "2018-11-06T21:20:08.143Z",
- "events": ["event.alert", "event.created"],
- "id": "4f9d73e63b7144ecb8944c41620a090b",
- "secret": "8fcac28aaa4c4f5fa572b61d40a8e084364db25fd37449c299e5a41c0504cbc2",
- "status": "active",
- "url": "https://empowerplant.io/sentry-hook"
- }
- ]
- }
- }
- },
- "403": {
- "description": "You do not have that feature enabled"
- }
- },
- "security": [
- {
- "auth_token": ["project:read"]
- }
- ]
- },
- "post": {
- "tags": ["Projects"],
- "description": "Register a new service hook on a project.\n\nEvents include:\n\n- event.alert: An alert is generated for an event (via rules).\n- event.created: A new event has been processed.\n\nThis endpoint requires the 'servicehooks' feature to be enabled for your project.",
- "operationId": "Register a New Service Hook",
- "parameters": [
- {
- "name": "organization_id_or_slug",
- "in": "path",
- "description": "The id or slug of the organization the client keys belong to.",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "project_id_or_slug",
- "in": "path",
- "description": "The id or slug of the project the client keys belong to.",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "required": ["url", "events"],
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "description": "The URL for the webhook."
- },
- "events": {
- "type": "array",
- "description": "The events to subscribe to.",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "example": {
- "url": "https://empowerplant.io/sentry-hook",
- "events": ["event.alert", "event.created"]
- }
- }
- },
- "required": true
- },
- "responses": {
- "201": {
- "description": "Success",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "../../components/schemas/service-hook.json#/ServiceHook"
- },
- "example": {
- "dateCreated": "2018-11-06T21:20:08.143Z",
- "events": ["event.alert", "event.created"],
- "id": "4f9d73e63b7144ecb8944c41620a090b",
- "secret": "8fcac28aaa4c4f5fa572b61d40a8e084364db25fd37449c299e5a41c0504cbc2",
- "status": "active",
- "url": "https://empowerplant.io/sentry-hook"
- }
- }
- }
- },
- "403": {
- "description": "You do not have that feature enabled"
- },
- "404": {
- "description": "The requested resource does not exist"
- }
- },
- "security": [
- {
- "auth_token": ["project:write"]
- }
- ]
- }
- }
|