Project groups API

Adding a project group

The method allows to add project groups to a user account.

Request format

POST https://api4.seranking.com/site-groups
{ “name” : “text” }

Parameters

NameRequiredDescription
nameYes Name of the project group to be added

Result

If successful, the server returns an array containing deletion statuses.

NameRequiredDescription
group_idYes ID of the added project group

Response example

{
“group_id”: 9545
}

Errors

HTTP codeError message
400 Empty name

Renaming a project group

Request format

PUT https://api4.seranking.com/site-groups/{group_id}
{
“name”: “new name”
}

Parameters

NameRequiredDescription
nameYes New project group name

Result

If successful, the server returns the 200 HTTP code.

Errors

HTTP codeError message
400 Empty name
404 Group not found

Deleting a project group

Request format

DELETE https://api4.seranking.com/site-groups/{group_id}

Result

If successful, the server returns the 204 HTTP code.

Errors

HTTP codeError message
404 Group not found

Project group list

The method allows to receive a list of all project groups from a user account.

Request format

 GET https://api4.seranking.com/site-groups

Result

If successful, the server returns a list of groups.

NameRequiredDescription
idYes Project group ID
nameYes New project group name

Response example

[
{
“id”: “123”,
“name”: “Group1”
},
{
“id”: “456”,
“name”: “Group2”
}
]

Moving projects to a project group

The method allows to transfer projects from one project group to another.

Parameters

NameRequiredDescription
site_idsYes An array containing the IDs of websites that are to be transferred

Request format

POST  https://api4.seranking.com/site-groups/{group_id}/sites
{
“site_ids” : [1,2,3,4,5]
}

Result

If successful, the server returns the 204 HTTP code.

Errors

HTTP codeError message
404 Group not found