Перейти к содержанию

SWAP CORE API 20250721.1255+365079f

API for the Core service of SWAP project


Auth


GET /api/v1/auth/regular/confirm-email/{key}/

Description

Confirm email of registered user

key * (required)
path
string -


Responses

HTTP 200 OK

GET /api/v1/auth/regular/email-verification-sent/

Description

Show sent status of verification email


Responses

HTTP 200 OK

Regular Auth


POST /api/v1/auth/regular/login/

Regular login with email

Request body

JSON
1
2
3
4
{
    "email": "[email protected]",
    "password": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        },
        "password": {
            "type": "string",
            "minLength": 1
        }
    },
    "required": [
        "email",
        "password"
    ]
}

JSON
1
2
3
4
{
    "email": "[email protected]",
    "password": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        },
        "password": {
            "type": "string",
            "minLength": 1
        }
    },
    "required": [
        "email",
        "password"
    ]
}

JSON
1
2
3
4
{
    "email": "[email protected]",
    "password": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        },
        "password": {
            "type": "string",
            "minLength": 1
        }
    },
    "required": [
        "email",
        "password"
    ]
}


Responses

HTTP 200 OK

JSON
1
2
3
4
5
{
    "username": "string",
    "email": "[email protected]",
    "password": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
    "type": "object",
    "properties": {
        "username": {
            "type": "string"
        },
        "email": {
            "type": "string",
            "format": "email"
        },
        "password": {
            "type": "string"
        }
    },
    "required": [
        "password"
    ]
}

GET /api/v1/auth/regular/logout/

GET Regular logout

Description

Regular logout


Responses

HTTP 200 OK

POST /api/v1/auth/regular/logout/

Regular logout


Responses

HTTP 200 OK

Regular Registration


POST /api/v1/auth/regular/register/

Regular register with email

Request body

JSON
1
2
3
4
5
6
{
    "email": "[email protected]",
    "password1": "string",
    "password2": "string",
    "role": "WORKER"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        },
        "password1": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        },
        "password2": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        },
        "role": {
            "$ref": "#/components/schemas/RoleEnum"
        }
    },
    "required": [
        "email",
        "password1",
        "password2",
        "role"
    ]
}

JSON
1
2
3
4
5
6
{
    "email": "[email protected]",
    "password1": "string",
    "password2": "string",
    "role": "WORKER"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        },
        "password1": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        },
        "password2": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        },
        "role": {
            "$ref": "#/components/schemas/RoleEnum"
        }
    },
    "required": [
        "email",
        "password1",
        "password2",
        "role"
    ]
}

JSON
1
2
3
4
5
6
{
    "email": "[email protected]",
    "password1": "string",
    "password2": "string",
    "role": "WORKER"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        },
        "password1": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        },
        "password2": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        },
        "role": {
            "$ref": "#/components/schemas/RoleEnum"
        }
    },
    "required": [
        "email",
        "password1",
        "password2",
        "role"
    ]
}


Responses

HTTP 201 Created

JSON
1
2
3
4
{
    "email": "[email protected]",
    "role": "WORKER"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email"
        },
        "role": {
            "$ref": "#/components/schemas/RoleEnum"
        }
    },
    "required": [
        "email",
        "role"
    ]
}

Regular Auth Verify


POST /api/v1/auth/regular/resend-verification-email/

Resend email verification

Request body

JSON
1
2
3
{
    "email": "[email protected]"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        }
    },
    "required": [
        "email"
    ]
}

JSON
1
2
3
{
    "email": "[email protected]"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        }
    },
    "required": [
        "email"
    ]
}

JSON
1
2
3
{
    "email": "[email protected]"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "minLength": 1
        }
    },
    "required": [
        "email"
    ]
}


Responses

HTTP 201 Created

JSON
1
2
3
{
    "email": "[email protected]"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
    "type": "object",
    "properties": {
        "email": {
            "type": "string",
            "format": "email"
        }
    },
    "required": [
        "email"
    ]
}

POST /api/v1/auth/regular/verify-email/

Verify email

Request body

JSON
1
2
3
{
    "key": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "key": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "key"
    ]
}

JSON
1
2
3
{
    "key": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "key": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "key"
    ]
}

JSON
1
2
3
{
    "key": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "key": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "key"
    ]
}


Responses

HTTP 200 OK

Regular Auth Jwt


POST /api/v1/auth/regular/token/refresh/

Regular token rotation (refresh)

Request body

JSON
1
2
3
{
    "refresh": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "refresh": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "refresh"
    ]
}

JSON
1
2
3
{
    "refresh": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "refresh": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "refresh"
    ]
}

JSON
1
2
3
{
    "refresh": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "refresh": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "refresh"
    ]
}


Responses

HTTP 200 OK

JSON
1
2
3
{
    "access": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
    "type": "object",
    "properties": {
        "access": {
            "type": "string",
            "readOnly": true
        }
    },
    "required": [
        "access"
    ]
}

POST /api/v1/auth/regular/token/verify/

Regular token verification

Request body

JSON
1
2
3
{
    "token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "token": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "token"
    ]
}

JSON
1
2
3
{
    "token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "token": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "token"
    ]
}

JSON
1
2
3
{
    "token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "type": "object",
    "properties": {
        "token": {
            "type": "string",
            "writeOnly": true,
            "minLength": 1
        }
    },
    "required": [
        "token"
    ]
}


Responses

HTTP 200 OK

User


GET /api/v1/auth/regular/user/

GET Regular user details

Description

Regular user details


Responses

HTTP 200 OK

JSON
1
2
3
4
{
    "pk": "16133a67-ba27-4b28-81e4-1ea4f23e2500",
    "email": "[email protected]"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "type": "object",
    "description": "User model w/o password",
    "properties": {
        "pk": {
            "type": "string",
            "format": "uuid",
            "readOnly": true,
            "title": "Id"
        },
        "email": {
            "type": "string",
            "format": "email",
            "readOnly": true
        }
    },
    "required": [
        "email",
        "pk"
    ]
}

PUT /api/v1/auth/regular/user/

PUT Regular user details

Description

Regular user details


Responses

HTTP 200 OK

JSON
1
2
3
4
{
    "pk": "ec0a5527-d300-45e7-ad8a-18d8b263b2f7",
    "email": "[email protected]"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "type": "object",
    "description": "User model w/o password",
    "properties": {
        "pk": {
            "type": "string",
            "format": "uuid",
            "readOnly": true,
            "title": "Id"
        },
        "email": {
            "type": "string",
            "format": "email",
            "readOnly": true
        }
    },
    "required": [
        "email",
        "pk"
    ]
}

PATCH /api/v1/auth/regular/user/

PATCH Regular user details

Description

Regular user details


Responses

HTTP 200 OK

JSON
1
2
3
4
{
    "pk": "c7dcca4c-224b-4463-99e4-a3bc9d1933a3",
    "email": "[email protected]"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "type": "object",
    "description": "User model w/o password",
    "properties": {
        "pk": {
            "type": "string",
            "format": "uuid",
            "readOnly": true,
            "title": "Id"
        },
        "email": {
            "type": "string",
            "format": "email",
            "readOnly": true
        }
    },
    "required": [
        "email",
        "pk"
    ]
}

Social Auth


POST /api/v1/auth/social/apple/login/

Social login with Apple account

Request body

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}


Responses

HTTP 200 OK

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

POST /api/v1/auth/social/facebook/login/

Social login with Facebook

Request body

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}


Responses

HTTP 200 OK

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

POST /api/v1/auth/social/google/login/

Social login with Google account

Request body

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}


Responses

HTTP 200 OK

JSON
1
2
3
4
5
{
    "access_token": "string",
    "code": "string",
    "id_token": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string"
        },
        "code": {
            "type": "string"
        },
        "id_token": {
            "type": "string"
        }
    }
}

Storage


GET /api/v1/storage/download/{asset_type}/{asset_id}/

Download asset from storage

asset_id * (required)
path
string -
asset_type * (required)
path
string -
document_type
query
string -


Responses

HTTP 200 OK

PUT /api/v1/storage/upload/

Upload file to storage

Request body

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "files": [
        "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQ="
    ],
    "data": [
        {
            "document_type": "Passport",
            "caption": "string",
            "owned_by_worker": "string",
            "owned_by_company": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
    "type": "object",
    "properties": {
        "files": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "binary"
            }
        },
        "data": {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/FileMetadataRequest"
            }
        }
    },
    "required": [
        "data",
        "files"
    ]
}


Responses

HTTP 200 OK

Version


GET /api/v1/version/


Responses

HTTP 200 OK

Schemas

DocumentTypeEnum

Type: string

FileMetadataRequest

Name Type
caption string
document_type DocumentTypeEnum
owned_by_company string
owned_by_worker string

FileUploadRequestRequest

Name Type
data Array<FileMetadataRequest>
files Array<string(binary)>

Login

Name Type
email string()
password string
username string

RegularLoginSerializerRequestRequest

Name Type
email string()
password string

RegularRegister

Name Type
email string()
role RoleEnum

RegularRegisterRequest

Name Type
email string()
password1 string
password2 string
role RoleEnum

ResendEmailVerification

Name Type
email string()

ResendEmailVerificationRequest

Name Type
email string()

RoleEnum

Type: string

SocialLogin

Name Type
access_token string
code string
id_token string

SocialLoginRequest

Name Type
access_token string
code string
id_token string

TokenRefresh

Name Type
access string

TokenRefreshRequest

Name Type
refresh string

TokenVerifyRequest

Name Type
token string

UserDetails

Name Type
email string()
pk string(uuid)

VerifyEmailRequest

Name Type
key string

Security schemes

Name Type Scheme Description
jwtCookieAuth apiKey
jwtHeaderAuth http bearer