Tag¶
Contents
Summary¶
Resource |
Operation |
Description |
---|---|---|
Tag |
Creates a new tag. |
|
Gets a single tag given its ID. |
||
Gets a list of all the tags. |
||
Updates an existing tag. |
||
Deletes a tag. |
Create¶
JSON Schema
Required parameters are in bold.
type |
object |
|
properties |
||
|
type |
string |
maxLength |
255 |
|
minLength |
1 |
|
additionalProperties |
False |
Creates a new tag.
Example request:
POST /tags HTTP/1.1 Host: 127.0.0.1 Content-Type: application/json { "value": "phish" }
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "id": 1, "value": "phish" }
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
201 Created – Tag created
400 Bad Request – JSON does not match the schema
401 Unauthorized – Invalid role to perform this action
409 Conflict – Tag already exists
Read Single¶
Gets a single tag given its ID.
Example request:
GET /tags/1 HTTP/1.1 Host: 127.0.0.1 Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "value": "phish" }
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – Tag found
401 Unauthorized – Invalid role to perform this action
404 Not Found – Tag ID not found
Read Multiple¶
Gets a list of all the tags.
Example request:
GET /tags HTTP/1.1 Host: 127.0.0.1 Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": 1, "value": "phish" }, { "id": 2, "value": "from_address" } ]
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – Tags found
401 Unauthorized – Invalid role to perform this action
Update¶
JSON Schema
Required parameters are in bold.
type |
object |
|
properties |
||
|
type |
string |
maxLength |
255 |
|
minLength |
1 |
|
additionalProperties |
False |
Updates an existing tag.
Example request:
PUT /tags/1 HTTP/1.1 Host: 127.0.0.1 Content-Type: application/json { "value": "from_address", }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "value": "from_address" }
- Request Headers
Authorization – Optional Apikey value
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – Tag updated
400 Bad Request – JSON does not match the schema
401 Unauthorized – Invalid role to perform this action
404 Not Found – Tag ID not found
409 Conflict – Tag already exists
Delete¶
Deletes a tag.
Example request:
DELETE /tags/1 HTTP/1.1 Host: 127.0.0.1
Example response:
HTTP/1.1 204 No Content
- Request Headers
Authorization – Optional Apikey value
- Status Codes
204 No Content – Tag deleted
401 Unauthorized – Invalid role to perform this action
404 Not Found – Tag ID not found
409 Conflict – Unable to delete tag due to foreign key constraints