API Documentation
Table of Contents
- FAQ
- Create a Takedown Request
- Retrieve All Takedown Requests
- Get Remaining Credits
- Get User Indicators
FAQ
Frequently Asked Questions
Q: How do I authenticate my API requests?
A: You must include your API token in the Authorization header of your requests.
Q: What should I do if I receive an error response?
A: Check the status code and response message for details. Ensure you have sufficient credits and valid input.
Q: How can I reset my API token?
A: You can revoke your existing token and generate a new one through the API token management endpoint.
Create a Takedown Request
Endpoint: /api/takedown/create
Method: POST
Use this endpoint to create a new takedown request. You must provide the following parameters:
- category: The category of the takedown (e.g., Phishing).
- description: A detailed description of the takedown.
- priority: The priority level (e.g., High, Medium, Low).
- indicators: An array of indicators related to the takedown.
Headers: Include an Authorization
header with your API token.
import requests
url = "http://127.0.0.1:5000/api/takedown/create"
api_token = "YOUR_API_TOKEN"
data = {
"category": "Phishing",
"description": "Phishing email received",
"priority": "High",
"indicators": ["indicator1", "indicator2"]
}
response = requests.post(url, headers={
"Authorization": api_token,
"Content-Type": "application/json"
}, json=data)
print(response.json())
$url = "http://127.0.0.1:5000/api/takedown/create"
$api_token = "YOUR_API_TOKEN"
$data = @{
"category" = "Phishing"
"description" = "Phishing email received"
"priority" = "High"
"indicators" = @("indicator1", "indicator2")
}
$response = Invoke-RestMethod -Uri $url -Method Post -Headers @{ Authorization = $api_token } -Body ($data | ConvertTo-Json)
$response
curl -X POST http://127.0.0.1:5000/api/takedown/create \
-H "Authorization: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"category": "Phishing", "description": "Phishing email received", "priority": "High", "indicators": ["indicator1", "indicator2"]}'
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "http://127.0.0.1:5000/api/takedown/create"
apiToken := "YOUR_API_TOKEN"
data := map[string]interface{}{
"category": "Phishing",
"description": "Phishing email received",
"priority": "High",
"indicators": []string{"indicator1", "indicator2"},
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", apiToken)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
Retrieve All Takedown Requests
Endpoint: /api/takedowns
Method: GET
This endpoint retrieves all takedown requests associated with your account.
url = "http://127.0.0.1:5000/api/takedowns"
api_token = "YOUR_API_TOKEN"
response = requests.get(url, headers={
"Authorization": api_token
})
print(response.json())
$url = "http://127.0.0.1:5000/api/takedowns"
$api_token = "YOUR_API_TOKEN"
$response = Invoke-RestMethod -Uri $url -Method Get -Headers @{ Authorization = $api_token }
$response
curl -X GET http://127.0.0.1:5000/api/takedowns \
-H "Authorization: YOUR_API_TOKEN"
package main
import (
"fmt"
"net/http"
)
func main() {
url := "http://127.0.0.1:5000/api/takedowns"
apiToken := "YOUR_API_TOKEN"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", apiToken)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println("Response:", result)
}
Get Remaining Credits
Endpoint: /api/user/credits
Method: GET
This endpoint retrieves the remaining credits for your account. If you are part of a company, it will return the company credits as well.
url = "http://127.0.0.1:5000/api/user/credits"
api_token = "YOUR_API_TOKEN"
response = requests.get(url, headers={
"Authorization": api_token
})
print(response.json())
$url = "http://127.0.0.1:5000/api/user/credits"
$api_token = "YOUR_API_TOKEN"
$response = Invoke-RestMethod -Uri $url -Method Get -Headers @{ Authorization = $api_token }
$response
curl -X GET http://127.0.0.1:5000/api/user/credits \
-H "Authorization: YOUR_API_TOKEN"
package main
import (
"fmt"
"net/http"
)
func main() {
url := "http://127.0.0.1:5000/api/user/credits"
apiToken := "YOUR_API_TOKEN"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", apiToken)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println("Response:", result)
}
Get User Indicators
Endpoint: /api/user/indicators
Method: GET
This endpoint retrieves all indicators associated with your takedown requests.
url = "http://127.0.0.1:5000/api/user/indicators"
api_token = "YOUR_API_TOKEN"
response = requests.get(url, headers={
"Authorization": api_token
})
print(response.json())
$url = "http://127.0.0.1:5000/api/user/indicators"
$api_token = "YOUR_API_TOKEN"
$response = Invoke-RestMethod -Uri $url -Method Get -Headers @{ Authorization = $api_token }
$response
curl -X GET http://127.0.0.1:5000/api/user/indicators \
-H "Authorization: YOUR_API_TOKEN"
package main
import (
"fmt"
"net/http"
)
func main() {
url := "http://127.0.0.1:5000/api/user/indicators"
apiToken := "YOUR_API_TOKEN"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", apiToken)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println("Response:", result)
}