{"servers":[{"url":"\/API\/notifications\/"}],"paths":{"\/v1\/webhooks\/":{"get":{"summary":"Get all webhooks","description":"\nRequired roles:\n - can_read_webhooks\n","responses":{"200":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhooksSchema"}}},"description":"Returns a list of webhooks"},"400":{"description":"Bad request"},"401":{"description":"Token is invalid"},"default":{"description":"Error response","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},{"type":"object","properties":{"errors":{"type":"object"}}}]},"examples":{"single":{"summary":"Example single message.","value":{"errors":["Example error message."]}},"multiple":{"summary":"Example multiple messages.","value":{"errors":{"field1":"Error message for field1","field2":"Error message for field2"}}}}}}}},"parameters":[{"name":"Auth-Token","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"App-ID","in":"header","required":true,"style":"simple","schema":{"type":"string"}}]},"post":{"summary":"Create a new webhook","description":"\nRequired roles:\n - can_write_webhooks\n","responses":{"201":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSchema"}}},"description":"Returns a created webhook"},"400":{"description":"Bad request"},"401":{"description":"Token is invalid"},"default":{"description":"Error response","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},{"type":"object","properties":{"errors":{"type":"object"}}}]},"examples":{"single":{"summary":"Example single message.","value":{"errors":["Example error message."]}},"multiple":{"summary":"Example multiple messages.","value":{"errors":{"field1":"Error message for field1","field2":"Error message for field2"}}}}}}}},"parameters":[{"name":"Auth-Token","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"App-ID","in":"header","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"body","required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookCreateSchema"}}}}}},"\/v1\/webhooks\/{webhook_id}\/":{"get":{"summary":"Get a webhook definition","description":"\nRequired roles:\n - can_read_webhooks\n","responses":{"201":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSchema"}}},"description":"Returns a webhook by it's ID"},"400":{"description":"Bad request"},"401":{"description":"Token is invalid"},"default":{"description":"Error response","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},{"type":"object","properties":{"errors":{"type":"object"}}}]},"examples":{"single":{"summary":"Example single message.","value":{"errors":["Example error message."]}},"multiple":{"summary":"Example multiple messages.","value":{"errors":{"field1":"Error message for field1","field2":"Error message for field2"}}}}}}}},"parameters":[{"name":"Auth-Token","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"App-ID","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"webhook_id","in":"path","required":true,"style":"simple","schema":{"type":"string"}}]},"put":{"summary":"Update a webhook","description":"\nRequired roles:\n - can_write_webhooks\n","responses":{"200":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookSchema"}}},"description":"Returns the updated webhook"},"400":{"description":"Bad request"},"401":{"description":"Token is invalid"},"default":{"description":"Error response","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},{"type":"object","properties":{"errors":{"type":"object"}}}]},"examples":{"single":{"summary":"Example single message.","value":{"errors":["Example error message."]}},"multiple":{"summary":"Example multiple messages.","value":{"errors":{"field1":"Error message for field1","field2":"Error message for field2"}}}}}}}},"parameters":[{"name":"Auth-Token","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"App-ID","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"webhook_id","in":"path","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"body","required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/WebhookCreateSchema"}}}}},"delete":{"summary":"Delete a webhook","description":"\nRequired roles:\n - can_delete_webhooks\n","responses":{"204":{"description":"Returns an empty body"},"400":{"description":"Bad request"},"401":{"description":"Token is invalid"},"default":{"description":"Error response","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},{"type":"object","properties":{"errors":{"type":"object"}}}]},"examples":{"single":{"summary":"Example single message.","value":{"errors":["Example error message."]}},"multiple":{"summary":"Example multiple messages.","value":{"errors":{"field1":"Error message for field1","field2":"Error message for field2"}}}}}}}},"parameters":[{"name":"Auth-Token","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"App-ID","in":"header","required":true,"style":"simple","schema":{"type":"string"}},{"name":"webhook_id","in":"path","required":true,"style":"simple","schema":{"type":"string"}}]}}},"info":{"title":"iconik Notifications","version":"2.0.0"},"openapi":"3.0.3","components":{"schemas":{"WebhookBaseSchema":{"type":"object","properties":{"event_type":{"type":"string","description":"Type of events. Example assets, collections","example":"assets"},"id":{"type":"string","format":"uuid"},"first_failed_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"headers":{"type":"object","description":"Define the key-value pairs your third party provider requires here","example":{"AUTH-TOKEN":"XYZ","SECRET":"asdad","S3_BUCKET_NAME":"iconik-examples","S3_REGION":"eu-west-1"},"additionalProperties":{"type":"string"}},"last_error":{"type":"string"},"operation":{"type":"string","nullable":true,"description":"Operation of event. Example create, update, delete","example":"update"},"last_payload":{"type":"string"},"deleted_at":{"type":"string","format":"date-time"},"date_created":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["ENABLED","DISABLED","FAILING","DELETED"],"example":"ENABLED"},"date_modified":{"type":"string","format":"date-time"},"realm":{"type":"string","nullable":true,"description":"Realm of event. Example entity, contents, acls, metadata","example":"metadata"},"object_id":{"type":"string","format":"uuid","nullable":true,"description":"ID of a particular object you want to subscribe on","example":"d7a5a7e8-4247-11ee-b3d8-a683e79fffaf"},"name":{"type":"string"},"url":{"type":"string","description":"URL you want to be called when notification is appeared","example":"https:\/\/example.com\/webhook_handler"},"query":{"type":"string","description":"Adding a query allows filtering out messages so webhooks will be called only if for messages that match this query.","example":"data.is_archived=false AND data.size>0 (data.status=\"CLOSED\" OR data.status=\"DELETED\") AND data.external_id!=null"}},"required":["event_type","id","status","url"]},"WebhookCreateSchema":{"type":"object","properties":{"event_type":{"type":"string","description":"Type of events. Example assets, collections","example":"assets"},"id":{"type":"string","format":"uuid","readOnly":true},"first_failed_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"headers":{"type":"object","description":"Define the key-value pairs your third party provider requires here","example":{"AUTH-TOKEN":"XYZ","SECRET":"asdad","S3_BUCKET_NAME":"iconik-examples","S3_REGION":"eu-west-1"},"additionalProperties":{"type":"string"}},"last_error":{"type":"string"},"operation":{"type":"string","nullable":true,"description":"Operation of event. Example create, update, delete","example":"update"},"last_payload":{"type":"string"},"deleted_at":{"type":"string","format":"date-time"},"date_created":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["ENABLED","DISABLED","FAILING","DELETED"],"example":"ENABLED"},"date_modified":{"type":"string","format":"date-time"},"realm":{"type":"string","nullable":true,"description":"Realm of event. Example entity, contents, acls, metadata","example":"metadata"},"object_id":{"type":"string","format":"uuid","nullable":true,"description":"ID of a particular object you want to subscribe on","example":"d7a5a7e8-4247-11ee-b3d8-a683e79fffaf"},"name":{"type":"string"},"url":{"type":"string","description":"URL you want to be called when notification is appeared","example":"https:\/\/example.com\/webhook_handler"},"query":{"type":"string","description":"Adding a query allows filtering out messages so webhooks will be called only if for messages that match this query.","example":"data.is_archived=false AND data.size>0 (data.status=\"CLOSED\" OR data.status=\"DELETED\") AND data.external_id!=null"}},"required":["event_type","status","url"]},"WebhookInternalSchema":{"type":"object","properties":{"event_type":{"type":"string","description":"Type of events. Example assets, collections","example":"assets"},"id":{"type":"string","format":"uuid"},"first_failed_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"headers":{"type":"string"},"last_error":{"type":"string"},"operation":{"type":"string","nullable":true,"description":"Operation of event. Example create, update, delete","example":"update"},"last_payload":{"type":"string"},"deleted_at":{"type":"string","format":"date-time"},"date_created":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["ENABLED","DISABLED","FAILING","DELETED"],"example":"ENABLED"},"date_modified":{"type":"string","format":"date-time"},"realm":{"type":"string","nullable":true,"description":"Realm of event. Example entity, contents, acls, metadata","example":"metadata"},"object_id":{"type":"string","format":"uuid","nullable":true,"description":"ID of a particular object you want to subscribe on","example":"d7a5a7e8-4247-11ee-b3d8-a683e79fffaf"},"name":{"type":"string"},"url":{"type":"string","description":"URL you want to be called when notification is appeared","example":"https:\/\/example.com\/webhook_handler"},"query":{"type":"string","description":"Adding a query allows filtering out messages so webhooks will be called only if for messages that match this query.","example":"data.is_archived=false AND data.size>0 (data.status=\"CLOSED\" OR data.status=\"DELETED\") AND data.external_id!=null"}},"required":["event_type","id","status","url"]},"WebhookSchema":{"type":"object","properties":{"event_type":{"type":"string","description":"Type of events. Example assets, collections","example":"assets"},"id":{"type":"string","format":"uuid","readOnly":true},"first_failed_at":{"type":"string","format":"date-time","readOnly":true},"description":{"type":"string"},"headers":{"type":"object","description":"Define the key-value pairs your third party provider requires here","example":{"AUTH-TOKEN":"XYZ","SECRET":"asdad","S3_BUCKET_NAME":"iconik-examples","S3_REGION":"eu-west-1"},"additionalProperties":{"type":"string"}},"last_error":{"type":"string"},"operation":{"type":"string","nullable":true,"description":"Operation of event. Example create, update, delete","example":"update"},"last_payload":{"type":"string"},"deleted_at":{"type":"string","format":"date-time"},"date_created":{"type":"string","format":"date-time","readOnly":true},"status":{"type":"string","enum":["ENABLED","DISABLED","FAILING","DELETED"],"example":"ENABLED"},"date_modified":{"type":"string","format":"date-time","readOnly":true},"realm":{"type":"string","nullable":true,"description":"Realm of event. Example entity, contents, acls, metadata","example":"metadata"},"object_id":{"type":"string","format":"uuid","nullable":true,"description":"ID of a particular object you want to subscribe on","example":"d7a5a7e8-4247-11ee-b3d8-a683e79fffaf"},"name":{"type":"string"},"url":{"type":"string","description":"URL you want to be called when notification is appeared","example":"https:\/\/example.com\/webhook_handler"},"query":{"type":"string","description":"Adding a query allows filtering out messages so webhooks will be called only if for messages that match this query.","example":"data.is_archived=false AND data.size>0 (data.status=\"CLOSED\" OR data.status=\"DELETED\") AND data.external_id!=null"}},"required":["event_type","id","status","url"]},"WebhooksSchema":{"type":"object","properties":{"objects":{"type":"array","items":{"$ref":"#\/components\/schemas\/WebhookSchema"}}}}}}}