MENU navbar-image

Introduction

Welcome to our API documentation!

Our API is still under construction and not everything is publicly available yet. If you have a use case for a specific endpoint not listed here, reach us at [email protected] so that we make it available.

Base URL

https://app.seowl.co/

Authenticating requests

Authenticate requests to this API's endpoints by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your API key by visiting your profile and clicking API Keys. Then fetch a token using api/token endpoint

Authentification

API endpoints related to authentification

Refresh a token.

Example request:
curl --request POST \
    "http://seowl.test/api/refresh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/refresh"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://seowl.test/api/refresh',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/refresh'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request   

POST api/refresh

Get a JWT via API Key

Example request:
curl --request POST \
    "http://seowl.test/api/token" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"key\": \"optio\"
}"
const url = new URL(
    "http://seowl.test/api/token"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "key": "optio"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://seowl.test/api/token',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'key' => 'optio',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/token'
payload = {
    "key": "optio"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "access_token": "<token>",
    "exp": 60
}
 

Example response (400):


{
    "error": "Invalid Api Key"
}
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

Request   

POST api/token

Body Parameters

key  string  

API key

Backlinks management

APIs for managing backlinks

requires authentication

Example request:
curl --request POST \
    "http://seowl.test/api/backlinks" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"urls\": \"quae\",
    \"tags\": [
        \"voluptas\"
    ],
    \"site_id\": \"qui\",
    \"expected_dofollow\": false,
    \"cost\": 15
}"
const url = new URL(
    "http://seowl.test/api/backlinks"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "urls": "quae",
    "tags": [
        "voluptas"
    ],
    "site_id": "qui",
    "expected_dofollow": false,
    "cost": 15
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://seowl.test/api/backlinks',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'urls' => 'quae',
            'tags' => [
                'voluptas',
            ],
            'site_id' => 'qui',
            'expected_dofollow' => false,
            'cost' => 15,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/backlinks'
payload = {
    "urls": "quae",
    "tags": [
        "voluptas"
    ],
    "site_id": "qui",
    "expected_dofollow": false,
    "cost": 15
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


[{
 "id": 1,
 "url": "https://www.google.com",
 "href": "",
 "anchor": "",
 "dofollow": false,
 "https": false,
 "live": false,
 "present": false,
 "indexed": false,
 "obl" : 0,
 "ip" : "",
 "geoloc": "",
 "cost": 100,
 "type": 1,
 "expected_dofollow": true,
 "tags" : []
 "site_id": 1
}]
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "site_id": [
            "The site_id field is required.",
            "The site_id field must be numerical"
        ],
        "urls": [
            "The urls field is required."
        ]
    }
}
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

IndexedAPI

APIs for indexation checking

Get the list of created tasks

requires authentication

Example request:
curl --request GET \
    --get "http://seowl.test/api/index/tasks" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/index/tasks"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://seowl.test/api/index/tasks',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/index/tasks'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


[
    {
        "id": 456,
        "name": "Task name",
        "user_id": 123,
        "deleted_at": null,
        "created_at": "2021-08-25T15:08:48.000000Z",
        "updated_at": "2021-08-25T15:08:48.000000Z",
        "not_indexed_count": 415,
        "indexed_count": 125,
        "processing_count": 45
    }
]
 

Request   

GET api/index/tasks

Create a new indexation check task

requires authentication

Example request:
curl --request POST \
    "http://seowl.test/api/index/tasks" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"quidem\",
    \"links\": [
        \"quod\"
    ]
}"
const url = new URL(
    "http://seowl.test/api/index/tasks"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "quidem",
    "links": [
        "quod"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://seowl.test/api/index/tasks',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'quidem',
            'links' => [
                'quod',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/index/tasks'
payload = {
    "name": "quidem",
    "links": [
        "quod"
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 456,
    "name": "Task name",
    "user_id": 123,
    "deleted_at": null,
    "created_at": "2021-08-25T15:08:48.000000Z",
    "updated_at": "2021-08-25T15:08:48.000000Z",
    "not_indexed_count": 415,
    "indexed_count": 125,
    "processing_count": 45
}
 

Request   

POST api/index/tasks

Body Parameters

name  string  

Task's name

urls  string optional  

List of backlinks to checks, separated by \n. Replace "links" param

links  string[]  

List of backlinks to check

Get details of a given task

requires authentication

Example request:
curl --request GET \
    --get "http://seowl.test/api/index/tasks/3615" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/index/tasks/3615"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://seowl.test/api/index/tasks/3615',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/index/tasks/3615'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
"id": 456,
"name": "Task name",
"user_id": 123,
"deleted_at": null,
"created_at": "2021-08-25T15:08:48.000000Z",
"updated_at": "2021-08-25T15:08:48.000000Z",
"not_indexed_count": 123,
"indexed_count": 456,
"processing_count": 78,
"items": [
{
"id": 123,
"url": "http://example.com",
"site_check": 0,
"inurl_check": 0,
"job_status": 0,
"indexed": 0,
"index_check_task_id": 19,
"created_at": "2021-08-25T15:08:48.000000Z",
"updated_at": "2021-11-23T15:06:38.000000Z"
},
]
}
 

Request   

GET api/index/tasks/{id}

URL Parameters

id  integer  

The ID of the task.

Delete a given task

requires authentication

Example request:
curl --request DELETE \
    "http://seowl.test/api/index/tasks/409" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/index/tasks/409"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'http://seowl.test/api/index/tasks/409',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/index/tasks/409'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{ 'status' : 'ok }
 

Request   

DELETE api/index/tasks/{id}

URL Parameters

id  integer  

The ID of the task.

Get remaining credits

requires authentication

Example request:
curl --request GET \
    --get "http://seowl.test/api/index/usage" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/index/usage"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://seowl.test/api/index/usage',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/index/usage'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{ 'credits' : 123 }
 

Request   

GET api/index/usage

Recheck a selected list of URLs

requires authentication

cost 1 credit per URL

Example request:
curl --request POST \
    "http://seowl.test/api/index/9/refresh" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ids\": [
        7
    ]
}"
const url = new URL(
    "http://seowl.test/api/index/9/refresh"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ids": [
        7
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://seowl.test/api/index/9/refresh',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'ids' => [
                7,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/index/9/refresh'
payload = {
    "ids": [
        7
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{}
 

Example response (400):


{
    'error' : 'insufficient_funds'
}
 

Request   

POST api/index/{task}/refresh

URL Parameters

task  integer  

Body Parameters

ids  integer[]  

List of task items to recheck

Keywords management

Get list of keywords from a website

requires authentication

Example request:
curl --request GET \
    --get "http://seowl.test/api/sites/662/keywords?id=et" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/sites/662/keywords"
);

const params = {
    "id": "et",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://seowl.test/api/sites/662/keywords',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'id'=> 'et',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/sites/662/keywords'
params = {
  'id': 'et',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


[{
  "id": 51,
  "keyword": "my keyword",
  "url_pattern": null,
  "rank_last_check_date": "2020-09-01T19:16:39.000000Z",
  "google_region_id": 3,
  "site_id": 5,
  "latitude": null,
  "longitude": null,
  "location_label": null,
}]
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

Request   

GET api/sites/{id}/keywords

URL Parameters

id  integer  

The ID of the site.

Query Parameters

id  string  

Site identifier

Sites management

APIs for managing sites

List the sites

requires authentication

Example request:
curl --request GET \
    --get "http://seowl.test/api/sites" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/sites"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://seowl.test/api/sites',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/sites'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


[
    {
        "id": 1,
        "name": "My website",
        "url": "https://www.google.com",
        "user_id": 12,
        "created_at": "2019-05-03 14:14:14",
        "updated_at": "2019-05-03 14:14:14"
    }
]
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

Request   

GET api/sites

Add a new website to user

requires authentication

Example request:
curl --request POST \
    "http://seowl.test/api/sites" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"ut\",
    \"url\": \"provident\",
    \"gsc\": false,
    \"findBacklinks\": true,
    \"region\": 11
}"
const url = new URL(
    "http://seowl.test/api/sites"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "ut",
    "url": "provident",
    "gsc": false,
    "findBacklinks": true,
    "region": 11
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://seowl.test/api/sites',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'ut',
            'url' => 'provident',
            'gsc' => false,
            'findBacklinks' => true,
            'region' => 11,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/sites'
payload = {
    "name": "ut",
    "url": "provident",
    "gsc": false,
    "findBacklinks": true,
    "region": 11
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 1,
    "name": "My website",
    "url": "https://www.google.com",
    "user_id": 12,
    "created_at": "2019-05-03 14:14:14",
    "updated_at": "2019-05-03 14:14:14"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "url": [
            "The url field is required."
        ]
    }
}
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

Request   

POST api/sites

Body Parameters

name  string  

Name of the site to add

url  string  

URL of the site to add

gsc  boolean optional  

findBacklinks  boolean optional  

region  integer optional  

Get details of a website

requires authentication

Example request:
curl --request GET \
    --get "http://seowl.test/api/sites/23925?id=unde" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/sites/23925"
);

const params = {
    "id": "unde",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://seowl.test/api/sites/23925',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'id'=> 'unde',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/sites/23925'
params = {
  'id': 'unde',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "id": 1,
    "name": "My website",
    "url": "https://www.google.com",
    "user_id": 12,
    "created_at": "2019-05-03 14:14:14",
    "updated_at": "2019-05-03 14:14:14"
}
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

Request   

GET api/sites/{id}

URL Parameters

id  integer  

The ID of the site.

Query Parameters

id  string  

Site identifier

Update the specified site details

requires authentication

Example request:
curl --request PUT \
    "http://seowl.test/api/sites/219?id=rerum" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"dolores\",
    \"url\": \"ut\"
}"
const url = new URL(
    "http://seowl.test/api/sites/219"
);

const params = {
    "id": "rerum",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "dolores",
    "url": "ut"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://seowl.test/api/sites/219',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'id'=> 'rerum',
        ],
        'json' => [
            'name' => 'dolores',
            'url' => 'ut',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/sites/219'
payload = {
    "name": "dolores",
    "url": "ut"
}
params = {
  'id': 'rerum',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload, params=params)
response.json()

Example response (200):


{
 "id": 1,
 "name": "My website",
 "url": "https://www.google.com",
 "user_id": 12,
}
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

Request   

PUT api/sites/{id}

PATCH api/sites/{id}

URL Parameters

id  integer  

The ID of the site.

Query Parameters

id  string  

Site identifier

Body Parameters

name  string  

New name of the site

url  string  

New URL of the site

Remove the specified site

requires authentication

Example request:
curl --request DELETE \
    "http://seowl.test/api/sites/1?id=voluptates" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://seowl.test/api/sites/1"
);

const params = {
    "id": "voluptates",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'http://seowl.test/api/sites/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'id'=> 'voluptates',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://seowl.test/api/sites/1'
params = {
  'id': 'voluptates',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "id": 1
}
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Example response (500):


{
    "message": "Server Error"
}
 

Request   

DELETE api/sites/{id}

URL Parameters

id  integer  

The ID of the site.

Query Parameters

id  string  

Site identifier