NAV Navbar

Overview

General information

The Flime API is created to work with tasks, users, and documents. After sing in as a company administrator, you can create freelancers, keep track of balance, assign tasks to freelancers, close and pay for tasks after they are completed, and receive accounting documents.

QuickStart will help you to understand, which API calls you need for the most popular cases in the system.

In the navigation bar you can find a description of all API calls currently existing in the system.

Current version API

The current API version is v2. You should specify the current API version in the URL of requests. So requested URL has to start with: https://api.flime.com/{version}.

HTTP verbs context

Method Description
GET Used to get resources view
POST Used to create a new resource view to collection. The format is "post-to-append"
PUT Used to update the state of resources view
PATCH Used to partially update of resources state
DELETE Used to delete resources view from collection

Authorizing Requests

Header Example

Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M

Every request you send to the Flime API must include an authorization token. The token also identifies you to Flime.

All requests to the Flime API must be authorized by an authenticated user. See detailed information about getting authorization token here. All other requests must include token in header parameters. The token has to look like: Bearer efJ08XAiOiJK...tzrCUEVW514Z8.

Roles and permissions

Access control is based on RBAC (Role Based Access Control). User has a role and role has a list of permissions.

There are 4 roles used in a public API:

  1. Company admin
  2. Company manager
  3. Custom company manager. This role includes the next groups with different permissions:

    • manageTasksGroup - user can create, update, read and delete his tasks.
    • acceptTasksWorkResultsGroup - user can read and accept task results.
    • makePaymentsGroup - user can make payments for the task.
    • manageAllTasksGroup - user can create, update, read and delete all company tasks.
    • inviteFreelancersGroup - user can invite new freelancers.
  4. Freelancer

Use a call GET /v2/users to get user role or all available permissions.

Permissions

Permissions determine what operations are allowed on a resource. Permissions are represented in the form of <resource><verb><rule>Permission, for example freelancerReadCompanyPermission. You don't assign permissions to users directly. Instead, you assign them a Role which contains one or more permissions.

The following table describes the available permissions:

Company admin Company manager Freelancer
Company balance Read Read -
User balance Read Read Read
Legal type Read Read Read
Company invoice Create, Read - -
KYC checking - - Create, Read
Payout - - Create, Read
Freelancer Group Create Create -
Freelancer Group Relation Create, Read Create, Read -
Task Create, Read, Update Create, Read, Update Read, Update
Task log Read Read Read
User Read, Create Read, Create Read, Create

Requirements for responses

Accept: application/json
Content-Type: application/json

All data should be sent and returned in JSON format. For each request should be specified two mandatory headers: Accept and Content-Type. Both values should be equal to application/json.

Error Handling

Error exaple

422 Unprocessable Entity

{
  "type": "yii-unprocessableentityhttpexception",
  "title": "Data validation failed",
  "invalid-params": [
    {
      "name": "balance_id",
      "reason": [
        [
          "Inssuficient funds on balance to payout '100000000.00 RUB'"
        ]
      ]
    },
    {
      "name": "amount",
      "reason": [
        [
          "Maximum amount for one payment is \"450000 RUB\""
        ]
      ]
    }
  ]
}

Operations that result in an error due to a problem with invalid input will standard one of the codes below:

HTTP Response Code Error description Error type
422 The submitted parameters were invalid in some way. Details about wrong parameters you can find in object invalid-params in resulted JSON. Validation error
401 The authorization token is invalid Authorization error
403 An authorized user has no permissions to make this request Access error
400 The request has an invalid structure Query Builder Error

For details about the error, you should pay attention to parameters type, title and other additional parameters if it exists in resulted JSON. For example, for error with code 422, all wrong parameters will be described in object invalid-params.

Quickstart

Quickstart shows you how to get started with Flime API and perform the most popular actions in the system.

This quickstart includes the next actions:

Quickstart

Before you begin

  1. Sign up as a company here and fill needed data about the company.
  2. Wait while your account will be confirmed.
  3. Set a 2FA (two-factor authorization) at your account

Get an authorization token

  1. Create temporary token using method POST /auth/token.
  2. Get 2FA (two-factor authentication) code with method POST /auth/tfa
  3. Get permanent token PATCH /auth/token

Add a new freelancer

  1. Find ID of your company with method, that will return detailed information about user. You can call GET /users with parameters:

    • filter[status_id]=4 for searching activated users;
    • filter[email]=<your email>;
    • expand=companies. With this parameter answer will include information about your company.

    The response will include object companies with company ID.

  2. Use call POST /users to add a new freelancer. You should know email, phone, and name of your freelancer. Also, you should set a password for freelancer's account.

    After creation of account the system will send an email with instructions for activating his account and changing temporary password.

  3. Verify freelancer phone number:

  4. Add a balance to freelancer account with method POST /payment-instruments. As input parameter you need a user ID, that was in response at step 3.

After these steps freelancer account will be activated and you can create and assign him new tasks.

Task workflow

Add a new task

Note: Don't forget to change authorization token of user with correct permissions to add task (usually company administrator or company manager).

  1. Get available legal types for your company with method GET /legal-types?company_id=. Legal types include categories (subcategories) and other attributes, that you can use for tasks creation.
  2. Create new task with method POST /tasks. You will need to select:
    • a type for your task (see available task types here)
    • a legal type and other attributes specified for the selected legal type (see step 1)
    • a language (see available list of languages here).
  3. Save the response.

Update task status

Note: Status can be changed in accordance with the task's workflow. See parameter next_statuses in response of POST /tasks for list of acceptable statuses.

  1. After task assigned to freelancer, he can take it to work. It means the status of the task has to be changed to IN_WORK. Use call PATCH /tasks/:id with new status ID in the parameter status_id. See available statuses here.
  2. When freelancer finishes working on the task, he changes task status to WAIT_FOR_ACCEPTANCE.

Pay for the task

Note: You can pay for the task only if you have a non-zero balance.

Company's manager checks the work and if he accepts it, he should change task status to WAIT_FOR_PAYMENT using call PATCH /tasks/:id. The funds will be transferred from the manager’s to freelancer's balance automatically. After this transfer, the task status should be changed to PAID.

Get a monthly report for completed tasks

Use a call GET /v2/company-report?filter[company_id]=«your company ID»‎ a monthly report for completed tasks.

Authorization

If you don't have an account, you need to sign up as a Freelancer or as a Company owner (as a Client) here.

For working with service you should use two-factor authentication. If you signed up your account just now, you should verify your phone number and email address.

To make authorized API calls you need a signed JSON Web Token. To decode tokens you can use JWT debugger. There are three steps to get a signed JWT token:

  1. Firstly you should create a temporary token using your email and password. In the response you will get a temporary token.
  2. After sending a temporary token, you will get the two-factor authentication code - a confirmation code, that usually user get on their phone when they try to authorize via UI.
  3. Finally, you should get permanent token after sending in a request a temporary token with two-factor authentication code.
  4. After 3 hours your permanent token becomes invalid and then, you have to authorize (make 1-3 steps) again. For staying authorized more than 3 hours, you can reissue your token while your signed token is still valid. The reissued token you could use three hours more.

With the permanent token, you will have full access to public API functions.

Create temporary token

Use this call to create a temporary token.

This token can be used only for completing two-factor authentication, but not for using all functionality of API.

Request example

curl -X POST \
  https://api.flime.com/v2/auth/token \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "your_email_here",
  "password": "your_password_here"
}'

Response example

HTTP status 200 OK

{
    "id": 1,
    "token": "eyJ0eXAiOiJK...X16kGyrbwGv8M",
    "tfa_default_device_id": 1,
    "tfa_devices": [
        {
            "id": 1,
            "type": {
                "id": 1,
                "title": "SMS"
            },
            "serial": "155****0555",
            "verified": true,
            "is_default": true
        }
    ]
}

Request

HTTP request

Authorization

This request doesn't need any authorization parameters.

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
email string Y User email address
password string Y User password. If you forget your password use a call POST auth/password-reset.

Response

Property name Value Description
id integer User ID
token string Temporary token
tfa_default_device_id string ID of the device used by default
tfa_devices array[object] A list of devices, which can be used to two-factor authentication.
tfa_devices.id string Device Identifier. You need this identifier to get a code of two-factor authentication.
tfa_devices.type object Device type. Valid values are:
  • SMS is SMS
  • G2A is Google Two Factor Authentication.
tfa_devices[].type.id integer Type Identifier
tfa_devices[].type.title string Type name
serial string Phone number
verified boolean Whether the device passed the verification process and can be used for two-factor authentication.
is_default boolean Whether the device is using by default.

Get two-factor authentication code

Request example

curl -X POST \
  https://api.flime.com/v2/auth/tfa \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -d '{
  "tfa_device_id": "your_tfa_device_id_here"
}'

Response example

HTTP status 200 OK

{
  "sms_code": "606121"
}

After getting a temporary token, you should get a code of two-factor authentication for signing a token. The code will be sent to the device from parameter tfa_device_id.

Request

HTTP request

Authorization

This request need temporary authorization token in the header parameters (read more about authorization).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
tfa_device_id string Y ID of device, where a code will be sent.
password string Y User password

Response

Property name Value Description
sms_code string A two-factor authentification code

Create permanent token

Request example

curl -X PATCH \
  https://api.flime.com/v2/auth/token \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -d '{
  "tfa": "your_tfa_here"
}'

Response example

HTTP status 200 OK

{
    "id": 392,
    "token": "efJ08XAiOiJK...tzrCUEVW514Z8"
}

To get a permanent token you need to send a temporary token with code of two-factor authentication.

Request

HTTP request

Authorization

This request needs temporary authorization token in the header parameters (read more about authorization).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
tfa string Y Code of two-factor authentication

Response

Property name Value Description
id integer User Identifier.
token string Updated token. You can use it for all next callings API.

Token reissue

Request example

curl -X PUT \
  https://api.flime.com/v2/auth/token \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "efJ08XAiOiJK...tzrCUEVW514Z8",
  "user_id": 123
}'

Response example

HTTP status 200 OK

{
    "user_id": 123,
    "token": "efJ1eXAiOiJK...YTB5vSyPz0yU4"
}

After 3 hours your permanent token becomes invalid and then you will have to authorize again. Use this call to reissue your active token while it is still valid.

Request

HTTP request

Authorization

This request need active authorization token in the header parameters (read more about authorization).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
token string Y Active token
user_id integer Y User ID

Response

Property name Value Description
token string Active token
user_id integer User ID

Restore password

To restore user's password you should:

  1. Send a letter to user with a link to your application and hash. This hash will be used for changing the password. User will receive a letter with a link on your app, which will contain a hash for the second step.
  2. Set a new password by calling the method with hash from the letter and a new password.

Restore password

Initialization of procedure

Request example

curl -X POST \
  https://api.flime.com/v2/auth/password-reset \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "test@test.com",
  "return_url": "https://example.com/forgot"
}'

This method sends an email to user with URL to your app and hash.

Request

HTTP request

Permissions

Do not need any permissions and available only for non-authorized users.

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
email string Y User email address
return_url string Y URL of your app which will be specify in email with instructions. For address from the example, the request URL will have the following format: https://example.com/forgot?hash=6b3b499fde73bc22cc020b0236ad4ab8

Response

If successful, this method returns HTTP status code 200 OK and empty result.

Change password

Request example

curl -X PATCH \
  https://api.flime.com/v2/auth/password \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \  
  -d '{
  "hash_forgot": "6b3b499fde73bc22cc020b0236ad4ab8",
  "password": "_new_password_here_"
}'

This method allows changing user password with the hash from the letter and a new password.

Request

HTTP request

Permissions

Do not need any permissions and available only for non-authorized users.

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
hash_forgot string Y Hash from the letter
password string Y New password

Response

If successful, this method returns HTTP status code 200 OK and empty result.

Sign up

Freelancer sign up

Request example

curl -X POST \
  'https://api.flime.com/v2/users?scenario=newFreelancerFromCompany' \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' \
  -d '{
    "email":"mail@example.com",
    "password":"123456789",
    "phone":{
        "number": 79991112234,
        "country_id": 182
    },
    "first_name":"fname",
    "last_name":"lname",
    "role":"roleFreelancer",
    "freelancer_group_id":"1",
    "status_id":"2",
    "company_id":"1"
}'

Response example

HTTP status code: 201 Created

{
  "id": 1
}

Use this call to create an account for a freelancer. This call can be initiated by Admin from the client's company. Firstly freelancer has a status REGISTERED. It means that user can authorize using the code from SMS, but the user doesn't have full access to the service. Then freelancer should upload his photo and passport. After the manager approves freelancer account, the user will have status ACTIVATED and full access to service.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Parameters

Query parameters

Parameter name Value Required Description
scenario string Y Scenario for creating user (parameter's value is permanent for this call and should be newFreelancerFromCompany).

Request body

Property name Value Required Description
email integer Y Freelancer email
phone object Y Phone object
phone.number object Y The phone number, which consists of the country code and freelancer number (for example, 79111231212 or 380681231212).
phone.country_id object Y Code of country. See a list of available countries here.
password object Y Password for freelancer account. Password has to be from 8 characters to 60, otherwise, the system will return an error.
first_name string Y Freelancer first name
last_name string Y Freelancer last name
company_id integer Y Company ID
status_id integer Y Freelancer status (parameter's value is permanent for this call and should be = 2, REGISTERED).
role string Y Freelancer role (parameter's value is permanent for this call and should be roleFreelancer).
freelancer_group_id integer Y Identifier of freelancers group. If you want to add freelancer to group, you should send here the identifier of the group. The group must belong to currently authorized user. If you do not want to add a user to the group, then send here 1. For change user group use the next call.

Response

Property name Value Description
id integer Identifier of the created user

Add freelancer to a group

Request example

curl -X POST \
  https://api.flime.com/v2/freelancer-groups/1/users/409 \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \

Use this call to add freelancer to the group.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need FreelancerGroupRelationCreateCompanyPermission to update freelancer groups (roles roleCompanyAdmin and roleCompanyWorker).

Parameters

Query parameters

Parameter name Value Required Description
freelancer_group_id integer Y Freelancer Group ID in system.
user_id integer Y Freelancer ID

Response

If successful, this method returns a HTTP code 201 Created and empty response body.

KYC

Use KYC (Know Your Customer) checking to verify the identity of users required to complete the onboarding process and enable withdrawals to be made.

Terminal initialization

Request example

curl -X POST \
  https://api.flime.com/v2/users/251/kyc-checks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json'

Response example

HTTP status 200 OK

{
    "terminal_url": "https://api.flime.com/kyc-terminal"
}

Use this call to inizialize a kyc-check terminal. In the response you will get a terminal URL, where you can upload passport and photo.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need KycCheckCreateUserPermission to initialize KYC terminal (role roleFreelancer).

Path parameters

Parameter name Value Required Description
user_id integer Y User ID

Request body

Do not supply any properties with this method.

Response

Property name Value Description
terminal_url string Terminal URL. You can use it to upload passport and photo via KYC terminal without API calls.

Initialization of checking

Request example

curl -X POST \
  https://api.flime.com/v2/kyc-checks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' \
  -d '{
  "passport_id": "112"
}'

Response example

HTTP status 200 OK

{
    "id": 100,
    "status": {
        "id": 1,
        "title": "CREATED"
    },
    "kyc_checks_driver_status": {
        "id": 1,
        "title": "OK"
    },
    "face": {
        "id": 501,
        "file": {
            "id": 1449,
            "filename": "test-passport.png"
        }
    },
    "passport": {
        "id": 500,
        "file": {
            "id": 1448,
            "filename": "test-passport.png"
        }
    },
    "is_actual": true,
    "value_total": null,
    "face_matching_similarity": null,
    "error_text": "",
    "reviewed_at": null,
    "created_at": "2019-06-18 05:53:03"
}

Before starting KYC check, you should upload passport image and attach user face image to it using API for creating the file.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need kycCheckCreateUserPermission and documentFileUploadPassportPermission to initialize KYC checking (role roleFreelancer).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
passport_id integer Y Passport ID

Response

If successful, this method returns the same response as method View checking data.

View checking data

Request example

curl -X GET \
  https://api.flime.com/v2/kyc-checks/100 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' \
  -d '{
  "passport_id": "112"
}'

Response example

HTTP status 200 OK

{
    "id": 100,
    "status": {
        "id": 3,
        "title": "ACCEPTED"
    },
    "kyc_checks_driver_status": {
        "id": 1,
        "title": "OK"
    },
    "face": {
        "id": 501,
        "file": {
            "id": 1449,
            "filename": "test-passport.png"
        }
    },
    "passport": {
        "id": 500,
        "file": {
            "id": 1448,
            "filename": "test-passport.png"
        }
    },
    "is_actual": true,
    "value_total": null,
    "face_matching_similarity": null,
    "error_text": "",
    "reviewed_at": "2019-06-18 05:58:57",
    "created_at": "2019-06-18 05:53:03"
}

Use this call to get information about KYC check.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need KycCheckReadPermission to read KYC checking reaults (role roleFreelancer).

Path parameters

Parameter name Value Required Description
kyc_check_id integer Y KYC check ID

Request body

Do not supply any properties with this method.

Response

Parameter name Value Description
id integer ID of checking
status object Status of checking. Valid values are:
  • CREATED - checking process was started, but the result is not ready.
  • DECLINED - result of checking is ready - user identity is not accepted.
  • ACCEPTED - result of checking is ready - user identity is accepted.
status.id integer Status ID
status.title string Status name
kyc_checks_driver_status object Status of KYC check driver. Valid values are:
  • CREATED - KYC check driver starts the process of user checking
  • PROCESSING - driver is in the process of checking
  • WAIT_FOR_MANUAL_PROCESSING - driver waits for manual processing
  • MANUAL_PROCESSING - process of cheking is performed manually by managers
  • PASSED - checking is finished and user identity is accepted
  • DECLINED - checking is finished and user identity is declined
  • ERROR - checking process finished with an error.
kyc_checks_driver_status.id integer KYC check driver status ID
kyc_checks_driver_status.title string KYC check driver status name
face object Data about user photo
face.id integer Photo ID
face.file object Information about photo
face[].file.id integer File ID
face[].file.filename string File name
passport object Data about photo of user passport
passport.id integer Passport ID
passport.file object Information about passport image
passport[].file.id integer File ID
passport[].file.filename string File name

Balance

Balance is an analog of bank account for users and companies.

Resource representations of balance

Represents a Balance variable.

 {
    "id": `integer`,
    "type": {
        "id": `integer`,
        "title": `string`
    },
    "money": {
        "amount": `float`,
        "currency": {
            "id": `integer`,
            "title": `string`
        }
    },
    "created_at": `datetime`
}
Property name Value Description
id integer Balance ID
type object Balance type. Valid values are:
  • USER is user's balance
  • COMPANY is company's balance.
type.id integer Balance type ID
type.title string Balance type name
money object Balance information
money.amount float Amount of money
money.currency object Currency information. See valid values here.
money[].currency.id integer Currency ID
money[].currency.title string Currency name
created_at datetime Creation date of balance

Get balances list

Request example

curl -X GET \
  'https://api.flime.com/balances?filter[company_id]=42' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json'

Response example

HTTP status 200 OK

{
    "items": [
        {
            "id": 42,
            "type": {
                "id": 8,
                "title": "COMPANY"
            },
            "money": {
                "amount": "1061.00",
                "currency": {
                    "id": 3,
                    "title": "EUR"
                }
            },
            "created_at": "2019-03-07 15:48:33"
        },
        {
            "id": 43,
            "type": {
                "id": 9,
                "title": "COMPANY_BANK"
            },
            "money": {
                "amount": "-100.00",
                "currency": {
                    "id": 1,
                    "title": "RUB"
                }
            },
            "created_at": "2017-04-04 09:19:44"
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.flime.com/v2/balances?filter%5Bcompany_id%5D=42&page=1"
        }
    },
    "_meta": {
        "totalCount": 2,
        "pageCount": 1,
        "currentPage": 1,
        "perPage": 50
    }
}

Use this call to get a list of balances filtered by different parameters.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

For this request you need the next permissions:

Parameters

Parameter name Value Required Description
filter[user_id] integer One of filters user_id or company_id is required User (freelancer) ID. If you want to get a company balance, this parameter should be empty. You should use this parameter only to get a freelancer balance.
filter[company_id] integer One of filters user_id or company_id is required Company ID. If you want to get a user balance, this parameter should be empty.
per-page integer N Quantity of balances on a page. Valid values: 1-1000. Value by default is 50.
page integer N Page number.

Request body

Do not supply any properties with this method.

Response

Property name Value Description
items[] array[object] List of Balance resource
_links object Auxiliary links for navigations
_links.self string Current request information
_links[].self.href string Full URL for getting a current result
_meta object General data of result
_meta.totalCount integer The total number of found balances
_meta.pageCount integer The total number of pages. You should use a parameter per-page for calculations.
_meta.currentPage integer Current page number.
_meta.perPage integer Total number of items on the one page.

Company account

Now it is available only one method for company account. The method allows to get categories, subcategories and other attributes for tasks, that requested company can use.

Represents a Legal type variable.

{
    "id":  `integer`,
    "category": {
        "id": `integer`,
        "title": `string`,
        "title_ru": `string`,
        "title_en": `string`,
        "title_lv": `string`,
        "is_hide": `boolean`
    },
    "attributes": [
        {
            "id": `integer`,
            "title": `string`,
            "title_ru": `string`,
            "title_en": `string`,
            "title_lv": `string`,
            "type": `string`,
            "sort": `integer`,
            "values": [
                {
                    "id": `integer`,
                    "value": `string`,
                    "value_ru": `string`,
                    "value_en": `string`,
                    "value_lv": `string`,
                    "sort": `integer`
                }
            ]
        }
    ],
    "title": `string`,
    "title_ru": `string`,
    "title_en": `string`,
    "title_lv": `string`,
    "title_doc": `string`,
    "title_doc_ru": `string`,
    "title_doc_en": `string`,
    "title_doc_lv": `string`,
    "created_at": `datetime`,
    "is_rights_transfer_mandatory": `boolean`,
    "is_rights_transfer_allowed": `boolean`,
    "is_vat_applicable": `boolean`,
    "code_okved": `string`,
    "sort": `integer`
}
Property name Value Description
id integer Legal type ID
title string Legal type name in the Russian language
title_en string Legal type name in the English language
title_lv string Legal type name in the Latvian language
title_doc string Documentation name of legal type in the Russian language
title_doc_en string Documentation name of legal type in the English language
title_doc_lv string Documentation name of legal type in the Latvian language
category object List of all categories for legal type.
category.id integer Category ID
category.title string Category name in the Russian language
category.title_en string Category name in the English language
category.title_lv string Category name in the Latvian language
attributes array[object] The set of attributes for legal type
attributes.id integer Attribute ID
attributes.title string Attribute name in the Russian language
attributes.title_en string Attribute name in the English language
attributes.title_lv string Attribute name in the Latvian language
attributes.type string Attribute type name
attributes.sort integer Value for sort. The first attribute in list should have a 0 value, the second - 1, etc.
attributes.values array[object] The list of valid attributes values
attributes[].values.id integer Value ID
attributes[].values.title string Value name in the Russian language
attributes[].values.title_en string Value name in the English language
attributes[].values.title_lv string Value name in the Latvian language
attributes[].values.sort integer Value for sort. The first attribute value in list should have a 0 value, the second - 1, etc.
created_at datetime Creation time of the legal type.
is_rights_transfer_mandatory boolean Whether a transfer of intellectual property is mandatory
is_rights_transfer_allowed boolean Whether a transfer of intellectual property is allowed
is_vat_applicable boolean Whether the vat is applicable
sort integer Value for sort. The first legal type in list should have a 0 value, the second - 1, etc.

Legal types are a set of tasks properties. Legal types include:

Request example

curl -X GET \
    'https://api.flime.com/v2/legal-types?company_id=1'
    -H 'Accept: application/json'
    -H 'Content-Type: application/json'  \

Response example

HTTP status code: 200 OK

{
    "items": [
        {
            "id": 1066,
            "category": {
                "id": 81,
                "title": "Design, photography and naming",
                "title_ru": "Дизайн, фото и нейминг",
                "title_en": "Design, photography and naming",
                "title_lv": null,
                "is_hide": false
            },
            "attributes": [
                {
                    "id": 2807,
                    "title": "Video format",
                    "title_ru": "Формат видео",
                    "title_en": "Video format",
                    "title_lv": "Video formāts",
                    "type": "select",
                    "sort": 0,
                    "values": [
                        {
                            "id": 26,
                            "value": "SD",
                            "value_ru": "SD",
                            "value_en": "SD",
                            "value_lv": null,
                            "sort": 0
                        },
                        {
                            "id": 29,
                            "value": "FullHD",
                            "value_ru": "FullHD",
                            "value_en": "FullHD",
                            "value_lv": null,
                            "sort": 2
                        }
                    ]
                }
            ],
            "title": "2D-animation development",
            "title_ru": "Разработка 2D анимации",
            "title_en": "2D-animation development",
            "title_lv": "2D animācijas izstrāde ",
            "title_doc": "Сreation of animated audiovisual materials by means of 2D-graphics",
            "title_doc_ru": "Создание анимированных аудиовизуальных произведений в двухмерной графике",
            "title_doc_en": "Сreation of animated audiovisual materials by means of 2D-graphics",
            "title_doc_lv": "Animētu audiovizuālo materiālu radīšana ar 2D grafikas palīdzību",
            "created_at": "2018-09-10 06:07:22",
            "is_rights_transfer_mandatory": 0,
            "is_rights_transfer_allowed": 1,
            "is_vat_applicable": 1,
            "code_okved": "74.10",
            "sort": 8
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.flime.com/v1/company/62/legal-type?page=1"
        },
        "next": {
            "href": "https://api.flime.com/v1/company/62/legal-type?page=2"
        },
        "last": {
            "href": "https://api.flime.com/v1/company/62/legal-type?page=8"
        }
    },
    "_meta": {
        "totalCount": 372,
        "pageCount": 8,
        "currentPage": 1,
        "perPage": 50
    }
}

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need LegalTypeReadCompanyPermission to read legal types for the requested company (roles roleCompanyAdmin, roleCompanyWorker, roleFreelancer and group manageTasksGroup for custom company manager).

Parameters

Parameter name Value Required Description
company_id integer Y Company ID
per-page integer N Total number of items on the one page. Valid values: 1-1000. Value by default is 50.
page integer N Page number

Request body

Do not supply any properties with this method.

Response

Property name Value Description
items[] array[object] List of Legal types
_links object Auxiliary links for navigations
_links[].self string Current request information
_links[].self.href string Full URL for getting a current result
_meta object General data of result
_meta.totalCount integer The total number of found balances
_meta.pageCount integer The total number of pages. You should use a parameter per-page for calculations.
_meta.currentPage integer Current page number.
_meta.perPage integer Total number of items on the one page.

Tasks

Working with tasks includes the next methods:

  1. View task details by its ID;
  2. Filter tasks by different parameters;
  3. Create new task;
  4. Update already existed task;
  5. Get task history - a list of task events, such as changes of status, financial operations or adding messages (comments) of a task.

Resource representation of task

Represents a Task variable.

{
    "id": integer,
    "title": string,
    "merchant_txid": integer,
    "has_new_messages": boolean,
    "tags": [
        {
            "id": integer,
            "title": string,
            "created_at": datetime
        }
    ],
    "next_statuses": [
        {
            "id": integer,
            "title": string
        }
    ],
    "type": {
        "id": integer,
        "title": string
    },
    "creator": {
        "id": integer,
        "first_name": string,
        "last_name": string,
        "avatar_file": string,
        "user_company_id": integer
    },
    "payer": integer,
    "company": {
        "id": integer,
        "name": string
    },
    "worker": {
        "id": integer,
        "first_name": string,
        "last_name": string,
        "email": string,
        "avatar_file": string,
        "user_company_id": integer
    },
    "status": {
        "id": integer,
        "title": string
    },
    "legal_type": object,
    "attributes_values": [
        {
            "id": integer,
            "value": list of integer
        }
    ],
    "description": string,
    "money": {
        "amount": float,
        "currency": {
            "id": integer,
            "title": string
        }
    },
    "commission_money": {
        "amount": float,
        "currency": {
            "id": integer,
            "title": string
        }
    },
    "file_count": integer,
    "paid_at": datetime,
    "ending_at": datetime,
    "created_at": datetime,
    "payout_type": {
        "id": integer,
        "title": string
    },
    "file_links": string,
    "copyright": boolean
}
Property name Value Description
id integer Task ID
title string Task header
merchant_txid integer Task ID for external systems
has_new_messages boolean Whether the task has new messages (comments)
tags object List of tags. See valid tags for your company here.
tags.id integer Tag task ID
tags.title string Tag name
tags.created_at datetime Date, when the tag was created
next_statuses array[object] List of statuses which task can have in accordance with the workflow.
next_statuses.id integer Status ID
next_statuses.title string Status name
type object Task type. Valid values are:
  • CABINET - task, that was created from UI (page https://app.flime.com/tasks)
  • API - task was created by calling public API method Create a task
  • FILE_IMPORT - task was created after import excel file on UI (page https://app.flime.com/tasks)
type.id integer Task type ID
type.title string Task type name
creator object Information about user, who created a task.
creator.id integer User ID
creator.first_name string User first name
creator.last_name string User last name
creator.avatar_file string Link to avatar file
creator.user_company_id integer Relation Identifier between user and company.
payer object Information about a user, who paid for the task
payer.id integer User ID
payer.first_name string User first name
payer.last_name string User last name
company object Information about the company.
company.id integer Company ID
company.name string Company name
worker object Information about Freelancer. Object has the same parameters as payer
status object Current task status. See valid statuses here.
status.id integer Status ID
status.title string Status name
legal_type object Description of subcategory and category of the task. See object view at page Legal types. Use a call Get legal types to get all acceptable types for your company.
attributes_values json Task attributes (on UI you can see these attributes in Technical requirements). This object has to be encoded as JSON. JSON-object has the following structure: [{"id": 1, "value": 22}].
description string Full task description
money object Information about cost of the task.
money.amount real Amount of money (for example, 14000.00)
money.currency object Currency information. See valid values here.
money[].currency.id integer Currency ID
money[].currency.title string Currency name
commission_money object Information about service commission for the current task.
commission_money.amount real Commission amount (for example, value 1680.00)
commission_money.currency object Currency description (object model the same as money[].currency)
file_count integer The number of attached files
paid_at string Date of payment in ISO-8601 format (2019-07-02 11:48:14)
ending_at string A completion date of the task in ISO-8601 format (2019-07-02 11:48:14)
created_at string Date the task was created in ISO-8601 format (2019-07-02 11:48:14)
payout_type object Payout type. Valid values see here.
file_links array[object] Links to all files, connected with the current task.
file_links.id integer File Identifier
file_links.url string Link for downloading a file
copyright string Whether the task can be considered completed only after the executor attaches the file with the result of the work.

View task details

Request example

curl -X GET \
  https://api.flime.com/v2/tasks/42 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M'

Response example

HTTP status code: 200 OK

{
    "id": 10245,
    "title": "new article about spiderman by thursday",
    "merchant_txid": null,
    "has_new_messages": true,
    "tags": [
        {
            "id": 12,
            "title": "urgent",
            "created_at": "2019-06-04 09:22:52"
        }
    ],
    "next_statuses": [
        {
            "id": 13,
            "title": "DRAFT"
        },
        {
            "id": 8,
            "title": "DECLINE_BY_CUSTOMER"
        }
    ],
    "type": {
        "id": 1,
        "title": "CABINET"
    },
    "creator": {
        "id": 100,
        "first_name": "John",
        "last_name": "Doe",
        "avatar_file": null,
        "user_company_id": 28
    },
    "payer": null,
    "company": {
        "id": 6,
        "name": "The Daily Bugle"
    },
    "worker": {
        "id": 982,
        "first_name": "Peter",
        "last_name": "Parker",
        "email": "peter.p@daily-bugle.com",
        "avatar_file": null,
        "user_company_id": 58
    },
    "status": {
        "id": 1,
        "title": "CREATED"
    },
    "legal_type": {
        "id": 1000,
        "title": "Услуги корреспондента",
        "title_ru": "Услуги корреспондента",
        "title_en": "Services of photoreporter",
        "title_lv": "Fotoreportiera pakalpojumi",
        "category": {
            "id": 57,
            "title": "Pro Active",
            "title_ru": "Про Эктив",
            "title_en": "Pro Active",
            "title_lv": "Pro Active",
            "is_hide": false
        },
        "attributes": [
            {
                "id": 5217,
                "title": "Project name",
                "title_ru": "Наименование проекта",
                "title_en": "Project name",
                "title_lv": "Projekta nosaukums",
                "type": "text",
                "sort": 0,
                "values": null
            }
        ]
    },
    "attributes_values": [
        {
            "id": 2217,
            "value": "[10, 100, 300]"
        }
    ],
    "description": "write an article on 10,000 characters. Be sure to post at least two photos",
    "money": {
        "amount": "19.95",
        "currency": {
            "id": 3,
            "title": "EUR"
        }
    },
    "commission_money": {
        "amount": "0.24",
        "currency": {
            "id": 3,
            "title": "EUR"
        }
    },
    "file_count": 0,
    "paid_at": null,
    "ending_at": "2019-08-15 14:52:01",
    "created_at": "2019-06-04 11:25:02",
    "payout_type": {
        "id": 1,
        "title": "Cards"
    },
    "file_links": null,
    "copyright": false
}

Use this call to get full information about the task.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need TaskReadCompanyPermission to view tasks (roles roleCompanyAdmin, roleFreelancer and groups manageAllTasksGroup, makePaymentsGroup, acceptTasksWorkResultsGroup for custom company manager).

Path parameters

Parameter name Value Required Description
task_id integer Y Task ID

Request body

Do not supply any properties with this method.

Response

If successful, this method returns a Task resource in the response body.

Search (filter) of task

Request example

curl -X GET \
  'https://api.flime.com/v2/tasks?filter[company_id]=60&sort=-created_at' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -H 'Content-Type: application/json'

Use this call to get tasks filtered by different parameters.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need TaskReadCompanyPermission to view tasks (roles roleCompanyAdmin, roleFreelancer and groups manageAllTasksGroup, makePaymentsGroup, acceptTasksWorkResultsGroup for custom company manager).

Parameters

To get tasks created by a requested company, it is necessary to set the input parameter filter[company_id]. If parameter filter[company_id] is empty, the search is executed on tasks assigned to the current user (freelancer).

Query parameters

Parameter name Value Required Description
per-page integer N Quantity of tasks on the one page. Valid values: 1-1000. Value by default - 50.
page integer N Page number.
filter[company_id] integer N Company Identifier. Use this parameter for working with task of your company. Otherwise, the search is executed on tasks assigned to the current user.
filter[title][like] integer N Title of the task. Use full or partial task name.
filter[status_id][in][] string N Task status Identifier. Acceptable task statuses see at Task statuses. If you need to filter a list of task by several parameters, you should use this parameter again: ...&filter[status_id][in][]=8&filter[status_id][in][]=1.
filter[legal_type_id] integer N Legal type Identifier. See available legal types for youe company here.
filter[task_tag_id] integer N Task tag ID. Acceptable task identifiers see at Dictionaries->Task tags
filter[worker_id] integer N Freelancer ID
filter[created_at][gt] string N Minimum creation time of the task (in a ISO-8601 format). You will receive all tasks created after this date.
filter[created_at][lt] string N Maximum creation time of the task (in a ISO-8601 format). You will receive all tasks created before this date.
filter[ending_at][gt] string N Minimum deadline time of the task (in a ISO-8601 format). You will receive all tasks created after this date.
filter[ending_at][lt] string N Maximum deadline time of the task (in a ISO-8601 format). You will receive all tasks created before this date.
sort string N The field which will be used for sorting results. There are list of properties available for sorting: id, title, status_id, ending_at, created_at. For sort in ascending order, you need to specify only a property (created_at), for sort in descending order you need to specify a leading minus «-» property (-created_at). For example, the next statement will sort all tasks from new to old: https://api.flime.com/v2/tasks?filter[company_id]=42&sort=-created_at.

Response

Property name Value Description
items array[object] List of Task resources
_links object Auxiliary links for navigations
_links.self string Current request information
_links[].self.href string Full URL for getting a current result
_meta object General data of result
_meta.totalCount integer The total number of found elements
_meta.pageCount integer The total number of pages. You should use a parameter per-page for calculations.
_meta.currentPage integer Current page number.
_meta.perPage integer Total number of items on the one page.

Create

Request example

curl -X POST \
  https://api.flime.com/v2/tasks \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -H 'Content-Type: application/json' \
  -d '{
 "worker_id": 982,
 "type_id": 1,
  "legal_type_id": 1000,
  "company_id": 6,
  "tags":[11,12],
  "end_date": "2020-08-15T15:52:01+01:00",
  "description": "write an article on 10,000 characters. Be sure to post at least two photos",
  "title": "new article about spiderman by thursday",
  "amount_data": {
    "amount": 19.95,
    "currency_id": 3,
    "payout_type_id": 1
  },
  "copyright": false,
  "attributes_ids": [
    {
      "attribute_id": 2717,
      "value": "[10, 100, 300]"
    }
  ]
}'

Response example

HTTP status code: 201 Created

Use this call to create new task in the system.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need TaskCreateCompanyPermission or taskCreateCompanyUserPermission to create new tasks (roles roleCompanyAdmin, roleFreelancer and group manageTasksGroup for custom company manager).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
worker_id integer Y Freelancer ID
type_id integer Y Type task Identifier. See valid task types here.
legal_type_id integer Y Legal type Identifier (subcategory and category of the task). See valid legal types for your company here.
company_id integer Y Company ID
language_id integer Y Language ID (see available list of languages here). This parameter set the language for sending email notifications about the task.
attributes_ids json Y Task attributes. These attributes will be located at block Technical requirements at task page. Valid attributes for selected legal type see here. This object has to be encoded as JSON. JSON-object has the following structure: [{"attribute_id": 1, "value": 22}].
end_date string Y Deadline time of the task (in a ISO-8601 format)
title string Y Task title
description string Y Description of task
amount_data array[object] Y Task cost
amount_data.amount real Y Amount of money (for example, 14000.00)
amount_data.currency_id integer Y Currency information. See valid values here.
amount_data.payout_type_id integer Y Payout type Identifier. See a list of valid types at part Cards and wallets->Payment instrument types
copyright boolean Y Whether the task can be considered completed only after the executor attaches the file with the result of the work.
tags array[integer] N List of tags identifiers. For receiving all tags, available for the current company use a call Get tags.
file_links array[string] N List of links for files that connected with current task

Response

If successful, this method returns a Task resource in the response body.

Update

Request example

curl -X PATCH \
  https://api.flime.com/v2/tasks/42 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -H 'Content-Type: application/json' \
  -d '{
  "status_id": 1,
  "tags": [
    1,
    2,
    3
  ],
  "legal_type_id": 2,
  "attributes_ids": [
    {
      "attribute_id": 9,
      "value": "[10, 100, 300]"
    }
  ],
  "end_date": "2018-08-15T15:52:01+01:00",
  "title": "_new_title_",
  "description": "_new_descripttion_",
  "amount_data": {
    "amount": 4.05,
    "currency_id": 1,
    "payout_type_id": 1
  },
  "copyright": true,
  "file_links": [
    {
      "url": "https://example.com/f1g",
      "has_copyright_transfer": true,
      "is_work_result": true
    }
  ]
}'

Use this call to update task in the system.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need TaskUpdateCompanyPermission and TaskUpdateCompanyTaskStatusPermission to update tasks (roles roleCompanyAdmin, roleFreelancer and group manageTasksGroup for custom company manager).

To change task statuses you need permissions, that depend on the statuses. Permission has the following structure: TaskStatusUpdateCompany<status name>Permission:

From status To status Permission Description Role and group
1 CREATED DRAFT TaskStatusUpdateCompanyDraftPermission Make a draft from created task roleCompanyAdmin and group manageTasksGroup
2 DRAFT CREATED TaskStatusUpdateCompanyCreatedPermission Make an active task from a draft roleCompanyAdmin
3 CREATED IN_WORK TaskStatusUpdateCompanyInWorkPermission Start a work progress on task roleFreelancer
4 CREATED / IN_WORK DECLINE_BY_WORKER TaskStatusUpdateCompanyDeclineWorkerPermission Decline a task by worker roleFreelancer
5 CREATED / IN_WORK / DECLINE_BY_WORKER / WAIT_FOR_PAYMENT DECLINE_BY_CUSTOMER TaskStatusUpdateCompanyDeclineCustomerPermission Decline a task by customer roleCompanyAdmin and groups manageTasksGroup, manageAllTasksGroup
6 IN_WORK WAIT_FOR_ACCEPTANCE TaskStatusUpdateCompanyWaitAcceptancePermission Finish a work progress on the task roleFreelancer
7 WAIT_FOR_ACCEPTANCE WAIT_FOR_PAYMENT TaskStatusUpdateCompanyWaitPaymentPermission Accept results of freelancer's work roleCompanyAdmin and group acceptTasksWorkResultsGroup
8 WAIT_FOR_PAYMENT PAID TaskStatusUpdateCompanyPaidPermission Pay for the task roleCompanyAdmin and group makePaymentsGroup
9 WAIT_FOR_ACCEPTANCE IN_WORK TaskStatusUpdateCompanyWaitAcceptanceInWorkPermission Return the task to the freelancer roleCompanyAdmin and group manageTasksGroup.

Change task status

Path parameters

Parameter name Value Required Description
task_id integer Y Task ID

Request body

Property name Value Required Description
status_id integer Y Task status identifier. The status can be changed in accordance with workflow. To find out the available statuses see property next_statuses or detailed status description.
tags array[integer] Y List of tags identifiers. Use a call Get tags to get acceptable tags.
legal_type_id integer Y Legal type Identifier (subcategory and category of the task). See available legal types for your company here.
attributes_ids array[object] N Task attributes. These attributes will be located at block Technical requirements at task page.
attributes_ids.attribute_id integer N Attribute ID
attributes_ids.value integer N Attribute value
end_date string N Deadline time in the format ISO-8601
title string N Task title
description string N Description of the task
amount_data object N Information about cost of the task.
amount_data.amount real Y Amount of money (for example, 14000.00)
amount_data.currency_id integer Y Currency information. See valid values here.
amount_data.payout_type_id integer N Payout type ID. See a list of available types at part here.
copyright boolean Y The flag indicationg that the task can be considered completed only after the executor attaches the file with the result of the work.
file_links array[object] N List of files connected with current task
file_links.url string N Link on the file
file_links.has_copyright_transfer boolean N Copyright transfer file link
file_links.is_work_result integer N The flag indicating that the attached file is the result of work on the task.

Response

If successful, this method returns an empty result with HTTP code 200 OK.

Get task history

Request example

curl -X GET \
  'https://api.flime.com/v2/tasks/42/logs?filter[type_id]=2' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -H 'Content-Type: application/json'

Response example

HTTP status code: 200 OK

{
    "items": [
        {
            "id": 770,
            "type": {
                "id": 2,
                "title": "STATUS_CHANGE"
            },
            "data": {
                "status_id": 1,
                "title": "CREATED",
                "user": {
                    "id": 242,
                    "first_name": "John",
                    "last_name": "Doe",
                    "avatar_file": null
                }
            },
            "created_at": "2019-04-04 08:49:07"
        },
        {
            "id": 793,
            "type": {
                "id": 1,
                "title": "MESSAGE"
            },
            "data": {
                "sender": {
                    "id": 242,
                    "first_name": "John",
                    "last_name": "Doe",
                    "avatar_file": null
                },
                "message": "lost relevance"
            },
            "created_at": "2019-04-05 11:15:12"
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.flime.com/v2/tasks/42/logs?page=1"
        }
    },
    "_meta": {
        "totalCount": 3,
        "pageCount": 1,
        "currentPage": 1,
        "perPage": 50
    }
}

Use this call to get the history of all changes in the requsted task.The response includes status changings, financial operations, and actions with task messages (comments). History results are returned in chronological order (increasing id).

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need TaskMessageReadPermission to get a history of requested task (roles roleCompanyAdmin, roleCompanyWorker, roleFreelancer and group manageAllTasksGroup for custom company manager).

Query parameters

Parameter name Value Required Description
id integer Y Task ID
filter[type_id] integer N Filter by the type of message. Valid values are:
  • MESSAGE (ID=1) - actions with messages (comments) of the task
  • STATUS_CHANGE (ID=2) - changes of task status
  • FINANCIAL_OPERATION (ID=3) - financial operations connected with task.

Request body

Do not supply any properties with this method.

Response

The response depends on type - parameter type_id.

Property name Value Description
items array[object] List of events matched requested criteria
items.id integer Identifier of task event
items.type object Event type
items[].type.id integer Identifier of event type
items[].data object Detailed data about event. The structure of this object depends on type of event (type_id). Below it is shown the structure for type STATUS_CHANGE.
items[].data.status_id integer Identifier of new task status
items[].data.title string Title of new task status
items[].data.user object Detailed data about the user who has changed task status
items[].data[].user.id integer User ID
items[].data[].user.first_name string User first name
items[].data[].user.last_name string User last name
items[].data[].user.avatar_file object User avatar
items[].data[].user[].avatar_file.id integer File ID
items[].data[].user[].avatar_file.created_at datetime Date when the avatar was uploaded in ISO-8601 format (2019-07-02 11:48:14)
items[].data[].user[].avatar_file.filename string Path to file
items[].created_at datetime Creation date of event
_links object Auxiliary links for navigations
_links[].self string Current request information
_links[].self.href string Full URL for getting a current result
_meta object General data of result
_meta.totalCount integer The total number of found elements
_meta.pageCount integer The total number of pages. You should use a parameter per-page for calculations.
_meta.currentPage integer Current page number.
_meta.perPage integer Total number of items on the one page.

Get task tags

Request example

curl -X GET \
    'https://api.flime.com/v2/task-tags?company_id=1'
    -H 'Accept: application/json'
    -H 'Content-Type: application/json'  \

Response example

HTTP status code: 200 OK

{
    "items": [
        {
            "id": 18,
            "company_id": 62,
            "title": "395",
            "created_at": "2019-05-17 09:38:18"
        },
        {
            "id": 17,
            "company_id": 62,
            "title": "1234",
            "created_at": "2019-04-18 08:08:31"
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.staging.flime.com/v2/task-tags?company_id=62&page=1"
        }
    },
    "_meta": {
        "totalCount": 2,
        "pageCount": 1,
        "currentPage": 1,
        "perPage": 50
    }
}

Use this call to get a list of tags available for the requested company.

If specify in query param ?expand=tasks, you will get all tasks assigned to current task tag (but you need TaskReadPermission for this operation)

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need taskTagReadCompanyPermission (roles roleCompanyAdmin and roleCompanyWorker) to get tags available for the requested company.

Parameters

Query parameters

Parameter name Value Required Description
per-page integer N Total number of task on the one page. Valid values: 1-1000. Value by default - 50
page integer N Page number.
expand string N Object, that will be added to the answer. Possible value: Task.

Response

Property name Value Description
items array[object] List of tags matched requested criteria
items.id integer Identifier of task tag
items.company_id integer Identifier of the company connected with tag
items.title string Tag title
items.created_at datetime Creation date of tag
_links object Auxiliary links for navigations
_link.self string Current request information
_links[].self.href string Full URL for getting a current result
_meta object General data of result
_meta.totalCount integer The total number of found elements
_meta.pageCount integer The total number of pages. You should use a parameter per-page for calculations.
_meta.currentPage integer Current page number.
_meta.perPage integer Total number of items on the one page.

Task statuses

Workflow of task statuses:

Task workflow

List of task statuses is shown below:

ID Code Description
1 CREATED Task was created, but freelancer has not taken it in a progress
2 IN_WORK Freelancer agreed with conditions of task and took it to progress
3 WAIT_FOR_ACCEPTANCE Task was completed by freelancer
4 WAIT_FOR_PAYMENT The task was taken to progress successfully by freelancer or by company Admin, and it waits for a payment
5 PAID Task successfully paid
6 DECLINE_BY_WORKER Freelancer declined the conditions of the task and canceled it
7 DECLINE_BY_CUSTOMER Freelancer or company admin declined task
8 ERROR_PAYOUT In the process of payout an error has occurred
9 DRAFT Draft of task

Files

This part contains methods that describe work with files in the system. Available methods:

  1. Create or import files. You should use import query for the files that import something to the system, for example tasks or freelancers. For creating any other file use query create file.
  2. Update files
  3. Delete file by its ID
  4. Download file

Permissions for Files API

You need different permissions to work with files having different types. There are 3 groups of files:

  1. Files from company account need permission file<name of operation>CompanyPermission, where name of operation depends on the request: create, update, delete or read.
  2. Files from user account need permission file<name of operation>UserPermission, where name of operation depends on the request: create, update, delete, export or read.
  3. Files from the task need permission file<name of operation>CompanyTaskPermission, where name of operation depends on the request: create, update, delete or read.

Resource representation of file

Represents a File variable.

{
    "id": integer,
    "owner": {
        "id": integer,
        "first_name": string,
        "last_name": string,
        "avatar_file": string
    },
    "type": {
        "id": integer,
        "title": string
    },
    "entity_type": {
        "id": integer,
        "title": string
    },
    "task_file": {
        "id": integer,
        "task_id": integer,
        "type": {
            "id": integer,
            "title": string
        },
        "has_copyright_transfer": boolean
    },
    "created_at": datetime,
    "updated_at": datetime,
    "filename": string
}
Property name Value Description
id integer File ID
owner object Owner object
owner.id integer User ID
owner.first_name string User first name
owner.last_name string User last name
owner.avatar_file string Path to user photo
type integer File type. See a list of available file types in requested parameters in a method of file creation.
entity_type object The entity in the system in which the file is created.
entity_type.id integer Entity type ID
entity_type.title string Entity type title
task_file object File from task
task_file.id integer File from task ID
task_file.task_id integer Task ID
task_file.type object Task type object
task_file[].type.id integer Type ID
task_file[].type.title string Type title
has_copyright_transfer boolean Whether the task can be considered completed only after the executor attaches the file with the result of the work.
created_at datetime Date, when file was created
updated_at datetime Date, when file was updated
filename string Path to file

Create file

Request example

curl -X POST \
  https://api.flime.com/v2/files \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'content-length: 244883' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F type_id=25 \
  -F entity_id=251 \
  -F file=/tmp/demo.jpg

Response example

HTTP status 200 OK

{
    "id": 1415,
    "additional_data": {
        "passport_id": 128
    },
    "filename": "demo.jpg"
}

Use this call to create new file in the system.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

You need to have permissions corresponding to the requested file type.

Parameters

Do not supply any parameters with this method.

Request body

Parameter name Value Required Description
type_id integer Y File type.
  • USERS_FILE (ID=15) - Freelancer's files
  • TASKS_FILE (ID=16) - Files added to tasks
  • TASKS_IMPORT_FILE (ID=21) - Files with task list for import
  • TYPE_FREELANCER_INVITE_IMPORT_FILE (ID=22) - Files with freelancer's list for import
  • TYPE_COMPANIES_CONTRACT_FILE (ID=24) - Agreement with the company
  • TYPE_PASSPORT_FILE (ID=25) - User's passport
  • TYPE_COMPANIES_INVOICE_FILE (ID=27) - Company's invoices
  • TYPE_COMPANY_REPORT_FILE (ID=29)
  • TYPE_REPORT_SF_REALIZATION_FILE (ID=30)
  • TYPE_RESELLERS_REPORT_FILE (ID=31)
  • TYPE_USER_FACE_FILE (ID=32) - User photo
  • TYPE_USER_AVATAR (ID=33) - User avatar
  • TYPE_COMPANY_LOGO (ID=34) - Company's logo
  • TYPE_DATA_EXPORT_FILE (ID=35)
  • TYPE_COMPANIES_PROCURA_FILE (ID=36) - Company's files
  • TYPE_COMPANIES_TASK_OVERVIEW_FILE (ID=37) - File with information about task for company
  • TYPE_COMPRESSED (ID=38)
  • TYPE_UTILITY_BILL (ID=39)
  • TYPE_FREELANCER_INVOICE_FILE (ID=40) - Invoices for freelancer
entity_id integer Y Identifier of entity. The entity in the system in which the file is created. For example, a file can be created as part of a task (then the task will be the entity) or the user may upload his photo (then the user will be the entity).
file string Y Path to file
entity_file_type_id integer N Entity subcategory.
additional_data[is_camera_photo] boolean Y Whether the file was uploaded from the gallery of a device or from camera

Response

Property name Value Description
id integer File type ID
additional_data array[] File additional attributes, which were specified and generated when the file was creating in the system
filename string File name

File import

Request example

curl -X POST \ 
    'https://api.flime.com/v2/file-import' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
    -H 'Content-Type: application/json' \

Response example

HTTP status code: 200 OK

{
  "id": 999
}

Use this call to import any supported object through a file (e.g. task).

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need FreelancerImportCompanyPermission to import documents with type TYPE_FREELANCER_INVITE_IMPORT_FILE (role roleCompanyAdmin and group inviteFreelancersGroup for custom company manager) and TaskImportCompanyPermission to import documents with type TYPE_TASKS_IMPORT_FILE (role roleCompanyAdmin and group manageTasksGroup for custom company manager).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
type_id integer Y File type. See method of file creation.
company_id integer Y Company ID
file_format string Y Imported file format/extention (e.g. xls, jpg)
file object Y File instance
additional_data string N Additional attributes

Response

Property name Value Description
id integer File ID

Delete file

Request example

curl -X DELETE \
    'https://api.flime.com/v2/files/1' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
    -H 'Content-Type: application/json' \

Use this call to delete file from the system.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

Permissions, that you need for this request, depends on file type:

  1. To delete file with type TYPE_TASKS_FILE and:

- subcategory TYPE_TASK_DESCRIPTION (file with task description) you need TaskFileDeleteCompanyTaskDescriptionPermission (acceptable for role roleCompanyAdmin and group manageTasksGroup); - subcategory TYPE_FINAL_RESULT (file added to the task as a result of work) you need TaskFileDeleteCompanyTaskFinalPermission (acceptable for roles roleCompanyAdmin and roleFreelancer); - subcategory TYPE_MESSAGE (user message at the task) you need TaskFileDeleteCompanyUserMessagePermission (acceptable for roles roleCompanyAdmin, roleCompanyWorker and roleFreelancer). 2. To delete files with type TYPE_COMPANY_LOGO (logo of the company) you need CompanyUpdateCompanyPermission (acceptable for roles roleCompanyAdmin and roleCompanyWorker). 3. To delete files with type TYPE_USER_AVATAR (user's avatar) you need UserUpdateUserPermission.

Path parameters

Property name Value Required Description
id integer Y File ID

Request body

Do not supply any properties with this method.

Response

If successful, this method returns HTTP status code 204 and empty result.

Update file

Request example

curl -X PATCH 
-H 'Content-Type: application/json' 
-H 'Accept: application/json' -d '1' 
'https://api.flime.com/v2/files/1'

Use this call to update file.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

Reauired permissions depends on the type of updated file. Now it's available to update only files with the type TYPE_TASKS_FILE and the following subcategories:

  1. TYPE_MESSAGE (file with task description). You need TaskFileUpdateTaskFinalPermission (acceptable for the role roleFreelancer);
  2. TYPE_FINAL_RESULT (file uploaded as a result od the task). You need TaskFileUpdateTaskMessagePermission (acceptable for the role roleFreelancer).

Path parameters

Property name Value Required Description
id integer Y File ID

Request body

Request body must include File resource in object body.

Response

If successful, this method returns an empty response with HTTP code 200 OK.

Get list of files for task

Request example

curl -X GET \
    'https://api.flime.com/v2/task/7/files' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
    -H 'Content-Type: application/json'

Response example

HTTP status 200 OK

{
    "items": [
        {
            "id": 3299,
            "owner": {
                "id": 522,
                "first_name": "testtt",
                "last_name": "testt",
                "avatar_file": null
            },
            "type": {
                "id": 16,
                "title": "TASKS_FILE"
            },
            "entity_type": {
                "id": 3,
                "title": "FINAL_RESULT"
            },
            "task_file": {
                "id": 1007,
                "task_id": 673,
                "type": {
                    "id": 3,
                    "title": "FINAL_RESULT"
                },
                "has_copyright_transfer": false
            },
            "created_at": "2019-07-02 10:40:00",
            "updated_at": null,
            "filename": "example-tasks-import6  копия.xls"
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.staging.flime.com/v2/tasks/673/files?page=1"
        }
    },
    "_meta": {
        "totalCount": 3,
        "pageCount": 1,
        "currentPage": 1,
        "perPage": 50
    }
}

Use this call to get a list of files, connected with requested task.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Path parameters

Parameter name Value Required Description
id integer Y Task ID

Query parameters

Parameter name Value Required Description
per-page integer N Quantity of task on the one page. Valid values: 1-1000. Quantity by default - 50
page integer N Page number

Request body

Do not supply any properties with this method.

Response

If successful, this method returns a File resource in the response body.

Download file

Request example

curl -X GET \
    'https://api.flime.com/v2/files/56565/download' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
    -H 'Content-Type: application/json'

Use this call to get a file in binary format with all the necessary HTTP headers for download.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

Needed permissions are different for different file types. See the following table with file types and required permissions.

File type Description Permission Role
TYPE_TASKS_FILE, subcategory TYPE_TASK_DESCRIPTION File with task description TaskFileDownloadCompanyTaskDescriptionPermission roleCompanyAdmin, roleFreelancer
TYPE_TASKS_FILE, subcategory TYPE_FINAL_RESULT File uploaded as a task result TaskFileDownloadCompanyTaskFinalPermission roleCompanyAdmin, roleFreelancer
TYPE_TASKS_FILE, subcategory TYPE_MESSAGE Message in the task TaskFileDownloadCompanyMessagePermission roleCompanyAdmin and group manageTasksGroup
TYPE_PASSPORT_FILE User passport UserPassportDownloadPermission
TYPE_COMPANY_REPORT_FILE Company invoice companyInvoiceDownloadCompanyPermission roleCompanyAdmin and group makePaymentsGroup
TYPE_COMPANY_LOGO Logo of the company CompanyReadCompanyPermission roleCompanyAdmin, roleCompanyWorker
TYPE_USER_AVATAR User avatar UserReadPermission
TYPE_DATA_EXPORT_FILE FileExportReadUserPermission roleCompanyAdmin, roleCompanyWorker, roleFreelancer
TYPE_COMPRESSED FileCompressReadUserPermission roleCompanyAdmin, roleCompanyWorker
TYPE_IMPORT_ERROR_FILE File with errors in the imported data fileImportReadCompanyPermission roleCompanyAdmin and groups inviteFreelancersGroup, manageAllTasksGroup, manageTasksGroup
TYPE_COMPANIES_PROCURA_FILE CompanyCreateOwnPermission roleCompanyAdmin
TYPE_COMPANIES_TASK_OVERVIEW_FILE File with task overview for the company companyTaskOverviewDownloadCompanyPermission roleCompanyAdmin и группа manageTasksGroup
TYPE_FREELANCER_INVOICE_FILE Freelancer invoice documentReadFreelancerInvoiceUserPermission roleFreelancer
TYPE_FREELANCER_REPORT_FILE Freelancer report documentReadFreelancerReportUserPermission roleFreelancer

Path parameters

Parameter name Value Required Description
id integer Y File ID

Query parameters

Parameter name Value Required Description
inline boolean N This attribute shows if we can send the file embedded or with a dialog of downloads (for images). Valid values: true, false.

Request body

Do not supply any properties with this method.

Response

If successful, this method returns a binary code of the file.

Documents

This part includes the method for downloading the report.

Resource representation of the report

Represents a Report variable.

{
    "id": integer,
    "type": {
        "id": integer,
        "title": string
    },
    "period_start": datetime,
    "period_end": datetime,
    "sku": string,
    "status": {
        "id": integer,
        "title": string
    },
    "files": [
    {
        "id": integer,
        "filename": string,
        "type": {
            "id": integer,
            "title": string
        },
        "created_at": datetime
    }
    ],
    "company_report": {
        "id": integer,
        "status": {
            "id": integer,
            "title": string
        },
    "money": {
        "amount": "0.00",
        "currency": {
            "id": integer,
            "title": string
        }
    },
    "vat_money": string
    },
    "company_invoice": integer,
    "advance_sfs": integer,
    "realization_sfs": integer,
    "error_text": string,
    "created_at": datetime
}
Property name Value Description
id integer Document ID
type object Document type
type.id integer Document type ID (for report downloading the value should be 2)
type.title string Document type name (for report downloading the value should be COMPANY_REPORT)
period_start datetime Creation date of the company in this system.
period_end datetime Finish date for the report's period (you can set the current date)
sku string Legal Document Number
status object Status of document type. Valid values are:
  • CREATED - request for generating a report is created, but the generating process wasn't started.
  • IN_PROCESS - the report is in process of generation.
  • GENERATED - the report is generated and ready for download.
  • ERROR - generating process was started and finished with an error, so the report couldn't be downloaded.
status.id integer Status ID
status.title string Status name
files array[object] Information about attached files
files.id integer Attached file ID
files.filename string Attached file name
files.type object File type. Valid file types for reports COMPANY_REPORT are:
  • MAIN_FILE,
  • MAIN_FILE_NOT_SIGNED.
files[].type.id integer File type ID
files[].type.type string File type name
files[].created_at datetime Date, when file was attached
company_report object Company report
company_report.id integer Company report ID
company_report.status object Status of company report. Valid statuses for reports with type COMPANY_REPORT are:
  • PREPARE_FOR_SEND - the report is ready, but it hasn't been sent yet,
  • SENT - the report was sent.
  • NOT_AVAILABLE - - the report could not be downloaded - it is not available at the current moment.
company_report[].status.id integer Status ID
company_report[].status.title string Status name
company_report[].money object Information about payments for the current report.
company_report[].money.amount real Amount of money (for example, 14000.00)
company_report[].money.currency object Currency for the current document. See valid values here.
company_report[].money[].currency.id integer Currency ID
company_report[].money[].currency.title string Currency name
company_report.money object Information about payments for the current report.
company_report.vat_money string A value-added tax (VAT)
company_invoice string A company invoice
advance_sfs string Advance invoice (only for Russian companies)
realization_sfs string Sales invoice (only for Russian companies)
error_text string An error occurred in the process of downloading a report
created_at datetime Creation date for the report

Download the report

Request example

curl -X GET \
  'https://api.flime.com/v2/company-report?filter[company_id]=1' \
  -H 'Content-Type: application/json' \

Response example

HTTP status code: 200 OK

{
  "items": [
        {
          "id": 87,
          "type": {
            "id": 2,
            "title": "COMPANY_REPORT"
          },
          "period_start": "2018-12-17 15:10:15",
          "period_end": "2018-12-17 15:10:15",
          "sku": "87-2",
          "status": {
            "id": 3,
            "title": "GENERATED"
          },
          "files": [
            {
              "id": 115,
              "filename": "",
              "type": {
                "id": 1,
                "title": "MAIN_FILE"
              },
              "created_at": "2018-12-17 15:10:43"
            }
          ],
          "company_report": {
            "id": 87,
            "status": {
              "id": 1,
              "title": "PREPARE_FOR_SEND"
            },
            "money": {
              "amount": "0.00",
              "currency": {
                "id": 3,
                "title": "EUR"
              }
            },
            "vat_money": null
          },
          "company_invoice": null,
          "advance_sfs": null,
          "realization_sfs": null,
          "error_text": null,
          "created_at": "2018-12-17 15:10:15"
        }
    ]
}

Use this call to get a list of available reports for company (report type = COMPANY_REPORT) for the period of its existence in the system. The response includes all parameters of the report, even its status.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need fileDownloadCompanyPermission to get a list of available reports for the requested company (role roleCompanyAdmin).

Parameters

Property name Value Required Description
filter[company_id] integer Y Company ID

Request body

Do not supply any properties with this method.

Response

If successful, this method returns a list of Report resource in the response body.

Company invoices

In current API version working with invoices is available only for companies. Creating or updating the invoices will cause a balance recharge. After creating a new invoice the system will form the document, that you could download by a link from the invoice properties.

Available actions with invoices:

Resource representation of company invoice

Represents a Company invoice variable.

{
    "id": integer,
    "status": {
        "id": integer,
        "title": string
    },
    "money": {
        "amount": real,
        "currency": {
            "id": integer,
            "title": string
        }
    },
    "document": {
        "id": integer,
        "period_start": datetime,
        "period_end": datetime,
        "sku": string,
        "status": {
            "id": integer,
            "title": string
        },
        "error_text": string,
        "created_at": datetime,
        "files": []
    }
}
Property name Value Description
id integer Invoice ID
status object Invoice status. Valid values are:
  • CREATED (id=1)
  • PAID (id=2)
status.id integer Status ID
status.title string Status name
money.amount real Amount of money
money.currency object Currency information. See valid values here.
money[].currency.id integer Currency ID
money[].currency.title string Currency name
document object Description of the document for payment
document.id integer Document ID
document.period_start string Beginning of the period for which the document is generated
document.period_end string End of the period for which the document is generated
document.sku string Document legal number
document[].status object Document status. Valid values are:
  • CREATED - request for generating a report is created, but the generating process wasn't started.
  • IN_PROCESS - the report is in process of generation.
  • GENERATED - the report is generated and ready for download.
  • ERROR - generating process was started and finished with an error, so the report couldn't be downloaded.
document[].status.id integer Status ID
document[].status.title string Status name
document[].error_text string Error information, if error occurred during invoice creation or payment processing.
document[].created_at datetime Creation date
document.files array[object] File description
document[].files.id integer File ID
document[].files.filename string File name
document[].files[].type array[object] File type description
document[].files[].type.id integer File description
document[].files[].type.title string File type name
document[].files.created_at datetime Date of file generation

Create a new invoice

Request example

curl -X POST \
  https://api.flime.com/v2/company-invoices \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -H 'Content-Type: application/json' \
  -d '{
  "company_id": "42",
  "additional_data": {
    "currency_id": 1,
    "amount": "1000"
  }
}'

Response example

HTTP status code: 200 OK

{
    "id": 1515,
    "status": {
        "id": 1,
        "title": "CREATED"
    },
    "money": {
        "amount": "1000.00",
        "currency": {
            "id": 2,
            "title": "USD"
        }
    },
    "document": {
        "id": 1515,
        "period_start": "2019-06-12 09:15:54",
        "period_end": "2019-06-12 09:15:54",
        "sku": "1515-1",
        "status": {
            "id": 2,
            "title": "IN_PROCESS"
        },
        "error_text": null,
        "created_at": "2019-06-12 09:15:54",
        "files": []
    }
}

Use this call to create a new invoice.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need documentCreateCompanyInvoicePermission to create company invoices for the requested company (roles roleCompanyAdmin and group makePaymentsGroup for custom company manager).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
company_id integer Y Company ID
additional_data object Y Invoice information
additional_data.currency_id integer Y Currency Identifier. See list of valid currencies here.
additional_data.amount real Y Amount of money

Response

If successful, this method returns a Company invoice resource in the response body.

View an invoice

Request example

curl -X GET \
  https://api.flime.com/v2/company-invoices/1455 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJK...X16kGyrbwGv8M' \
  -H 'Content-Type: application/json'

Gets a company invoice by its ID.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need documentReadCompanyInvoiceCompanyPermission to view company invoices for the requested company (roles roleCompanyAdmin and group makePaymentsGroup for custom company manager).

Parameters

Parameter name Value Required Description
invoice_id integer Y Invoice ID

Request body

Do not supply any properties with this method.

Responses

If successful, this method returns a Company invoice resource in the response body.

Work with users

This part contains method that allow the user to manage the list of all employees.

Search of users

Request example

curl -X GET \
  'https://api.flime.com/v2/users?filter[status_id]=2&filter[company_id]=1' \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' 

Response example

HTTP status code: 200 OK

{
    "items": [
        {
            "id": 656,
            "email": "test@gmail.com",
            "first_name": "FirstName",
            "last_name": "LastName",
            "middle_name": null,
            "has_address": false,
            "is_kyc_verified": false,
            "default_company_id": null,
            "avatar_file": null,
            "country": {
                "id": 4,
                "country_name": "Algeria"
            },
            "address": {
                "city": null,
                "street": null,
                "post_code": null
            },
            "currency": null,
            "default_language": {
                "id": 1,
                "title": "Russian",
                "code": "ru-RU"
            },
            "email_confirmed": null,
            "phone_confirmed": null,
            "authenticated_at": null,
            "birthday": null,
            "ip_global_restriction": null,
            "created_at": "2019-07-05 11:24:52",
            "roles": [
                "roleFreelancer"
            ],
            "tax_type_id": null
        }]
}

The method returns created users, connected with the company-customer account filtered by different criteria.

Valid combinations of filter criteria:

At least one of the above filter combinations had to be sent in the request. A query with other combinations or without any filter parameters will return an error.

You could request additional data about users by using extended fields (see parameter expand).

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need UserReadPermission to view information about user (roles roleCompanyAdmin, roleCompanyWorker and roleFreelancer).

Parameters

Parameter name Value Required Description
fields integer N List of fields for the response. Otherwise, the method will return all fields except fields with expanding. Expanding fields require permissions and for getting them you should use the field expand.
filter[email] string N Filter by user email address
filter[status_id] integer N Filter by current user status identifier. Valid values are:
  • CREATED (ID = 1) - the user is created, but not activated
  • REGISTERED (ID = 2) - the user is registered
  • CHECKED (ID = 3) - the user was checked by the manager
  • ACTIVATED (ID = 4) - the user's account was verified and activated by the manager
  • BLOCKED (ID = 5) - the user is blocked
  • INVITED (ID = 6) - freelancer was invited by the company's account
filter[company_id] integer N Filter by company identifier. You should send an identifier of authorized user company, otherwise, it will be an error in the result.
filter[role] string N Filter by user role. Valid values are:
  • roleFreelancer for freelancers, working with current company
  • roleCompanyWorker for company managers.
expand string N Additional fields that have constraints to access. You need permissions to have access to these fields:
  • companies includes information about all companies connected with the user. Also, it includes all user permissions in these companies.
  • company_ids includes list of ID of all companies connected with the user.
  • freelancer includes special information about freelancer. It includes next parameters: freelancer Id, specializations, balances and status.
  • phones includes all phone numbers connected with account. It includes next parameters: number, country_id, is_default (if current phone number is used by default) and phone_code (it means phone code of a country).
  • id_documents includes identifier of user's passport object, identifier of file and date, when it had been uploaded.

Request body

Do not supply any parameters with this method.

Response

If successful, this method returns a list of users in the object items.

Property name Value Description
id integer User ID
email string User email
first_name string User first name
last_name string User last name
middle_name string User middle name
has_address boolean Whether user filled his address
is_kyc_verified boolean Whether user is verified by KYC check driver
default_company_id integer Company ID
avatar_file string User avatar photo
country object User country. See valid values here.
country.id integer Country ID
country.country_name string Country name
address object User address
address.city string City
address.street string Street
address.post_code string Post code
currency object Currency information. See valid values here.
currency.id integer Currency ID
currency.title string Currency name
default_language object Default language. See valid values here.
default_language.id integer Language ID
default_language.title string Language title
default_language.code string Language code
email_confirmed boolean Whether user email is confirmed
phone_confirmed boolean Whether user phone is confirmed
authenticated_at string
birthday datetime User birthday
ip_global_restriction string IP-addresses, that is restricted to access
created_at datetime Creation date
roles[] list List of user roles
tax_type_id integer Tax type ID

Payment instruments

Payment instruments is used for withdrawal of funds from the balance.

Payment instrument types

Valid payment instruments are:

  1. Bank card
  2. Qiwi wallet
  3. Webmoney
  4. PayPal
  5. Epayments wallet

Create payment instrument

Request example

curl -X POST \
  https://api.flime.com/v2/payment-instruments \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' \  
  -d '{
  "user_id": "251",
  "type_id": "1",
  "currency_id": "1",
  "redirect_url": "https://example.com/your-payment-instrument-is-added"
}'

Response example

HTTP status 200 OK

{
    "user_payment_instrument_id": 240,
    "payment_instrument_id": 240,
    "type": {
        "id": 1,
        "title": "Cards"
    },
    "status": {
        "id": 1,
        "title": "CREATED"
    },
    "currency": {
        "id": 1,
        "title": "RUB"
    },
    "terminal_url": "https://terminal.example.com/start",
    "created_at": "2019-06-13 09:48:18",
    "is_automatic_payment": true
}

Use this call to create a new payment instrument.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need PaymentInstrumentCreateUserPermission to create payment instrument for account of authorized user (role roleFreelancer).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
user_id integer Y User ID
type_id integer Y Payment instrument type ID. See a list of acceptable types here
currency_id integer Y See a list of available currencies here
redirect_url integer Y Determines URL where the system will redirect the user after the user finishes actions in the terminal

Response

Property name Value Description
user_payment_instrument_id integer Relation ID between payment instrument and user
payment_instrument_id integer Payment instrument ID
type object Payment instrument type. See a list of available types here
type.id integer Payment instrument type ID
type.title string Payment instrument type name
status object Status of payment instrument. Valid values are:
  • CREATED - payment instrument is created.
  • APPROVED - payment instrument is approved and can be used if payouts.
  • BLOCKED - payment instrument is not active.
status.id integer Status ID
status.title string Status name
currency object Currency information. See a list of available currencies here
currency.id integer Currency ID
currency.title string Currency name
terminal_url string Terminal URL. Use it for displaying user PSI DSS terminal for adding a new card.
created_at string Creation date
is_automatic_payment boolean Whether to set the current payment instrument for auto payment.

Delete payment instrument

Request example

curl -X DELETE \
  https://api.flime.com/v2/users/42/payment-instruments/240 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8'  

Use this call to delete payment instrument.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need userPaymentInstrumentDeleteUserPermission to delete payment instrument for account of authorized user (role roleFreelancer).

Path parameters

Parameter name Value Required Description
user_id integer Y User ID
user_payment_instrument_id integer Y Relation ID between user and payment instrument

Request body

Do not supply any properties with this method.

Response

If successful, this method returns an empty response with HTTP Code 204.

Payouts

After the company's manager marks a task as completed, the freelancer gets money for this task on his balance. The funds are transferred from the company's balance to the freelancer's balance. Then freelancer can create a payout of money from his balance.

If freelancer adds a payment instrument in his account settings, payouts will perform automatically. So funds will not be added to freelancer's balance - it will be transferred to his payment instrument. A freelancer will see funds only at his financial history and directly at the balance of his payment instrument.

Available methods for work with payouts:

  1. Initialize new payout
  2. View payout information.

Note: There are restrictions on the maximum amount of funds that can be paid in one payout:

  1. For currency RUB - 450000.00 RUB.
  2. For currency EUR - 2500.00 EUR.
  3. For currency USD - 2700.00 USD.

Initialize payout

Request example

curl -X POST \
  https://api.flime.com/v2/payout-requests \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' \
  -d '{
  "balance_id": "1234",
  "user_payment_instrument_id": "250",
  "amount": "700",
  "is_conversion_allowed": true
}'

Response example

HTTP status 200 OK

{
    "id": 98,
    "status": {
        "id": 5,
        "title": "FULLY_PAID"
    },
    "payouts": [
        {
            "id": 86,
            "status": {
                "id": 4,
                "title": "PAID"
            },
            "money": {
                "amount": "350",
                "currency": {
                    "id": 3,
                    "title": "EUR"
                }
            },
            "transaction_id": 650,
            "paid_at": "2019-06-20 10:23:06",
            "created_at": "2019-06-20 10:23:04"
        },
        {
            "id": 87,
            "status": {
                "id": 4,
                "title": "PAID"
            },
            "money": {
                "amount": "350",
                "currency": {
                    "id": 3,
                    "title": "EUR"
                }
            },
            "transaction_id": 651,
            "paid_at": "2019-06-20 10:23:06",
            "created_at": "2019-06-20 10:23:05"
        }
    ],
    "paid_at": "2019-06-20 10:23:06",
    "created_at": "2019-06-20 10:23:03"
}

Use this call to inizialize a new payout.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need PayoutCreateUserPermission to initialize payout for account of authorized user (role roleFreelancer).

Parameters

Do not supply any parameters with this method.

Request body

Property name Value Required Description
balance_id integer Y Balance ID. Use a call Get balances list with input parameter filter[user_id] for receiving your balance ID.
user_payment_instrument_id object Y ID of payment instrument, where money will be sent. See a list of valid payment instruments here.
amount integer Y Amount of money (for example, 14000.00).
is_conversion_allowed boolean Y Whether the user agree to convert currencies. If the currency of payment instrument is different from the currency of a balance, this parameter has to be True . If currencies are the same, this flag is not required.

Response

Property name Value Description
id integer Payout ID
status object Status
status.id integer Status ID
status.title string Status name
payouts array[object] Payout information. Depending on the payment gateway or if an amount of current payout is more then maximum limit, the payment may be broken into several smaller ones. The properties of payouts are the same as in method View payout information
paid_at string Date and time when the payment process was finished
created_at string Creation time of payout

View payout information

Request example

curl -X GET \
  https://api.flime.com/v2/payouts/86 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json'  

Response example

HTTP status 200 OK

{
    "id": 86,
    "status": {
        "id": 4,
        "title": "PAID"
    },
    "money": {
        "amount": "350",
        "currency": {
            "id": 3,
            "title": "EUR"
        }
    },
    "transaction_id": 650,
    "paid_at": "2019-06-20 10:23:06",
    "created_at": "2019-06-20 10:23:04"
}        

Use this call to view information about requested payout.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need PayoutReadUserPermission to view payout for account of authorized user (role roleFreelancer).

Path parameters

Parameter name Value Required Description
payout_id integer Y Payout ID

Request body

Do not supply any properties with this method.

Response

Parameter name Value Description
id integer Payout ID
status object Payout status
status.id integer Status ID
status.title string Status name
money object Amount and currency information.
money.amount real Amount of money
money.currency object Currency information. See a list of valid currencies here.
money[].currency.id integer Currency ID
money[].currency.title string Currency name
transaction_id integer Transaction ID
paid_at datetime Date and time when the payment process was finished
created_at datetime Creation time of payout

TFA-devices

TFA-devices are used for two-factor authentication and other situations when you need a special approve of operation.

Send a code to device

Request example

curl -X POST \
  https://api.flime.com/v2/devices/42/code \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json'

Use this call to send a code to your device. See method Create temporary token to get a list of your devices.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Permissions

This request need SmsCreateUserPermission to send SMS code for the requested user (roles roleCompanyAdmin, roleCompanyWorker, roleFreelancer).

Path parameters

Parameter name Value Required Description
device_id integer Y TFA-device ID

Do not supply any parameters with this method.

Request body

Do not supply any properties with this method.

Responses

If successful, this method returns a empty response with HTTP-code 201 Created.

Device verification

Request example

curl -X PUT \
  https://api.flime.com/v2/devices/42 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer efJ08XAiOiJK...tzrCUEVW514Z8' \
  -H 'Content-Type: application/json' \
  -d '{
    "code": "293555"
}'

Use this call to verify your device. You will need to verify your device if you use it firstly.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Path parameters

Parameter name Value Required Description
device_id integer Y TFA-device ID

Request body

Property name Value Required Description
code integer Y Code

Response

If successful, this method returns a empty response with HTTP-code 200 OK.

Dictionaries

Registry of system dictionaries

Languages

Languages dictionary is based on ISO 639-2.

Request example

curl -X GET \
  'https://api.flime.com/v2/languages' \
  -H 'Content-Type: application/json' \

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Parameters

Property name Value Required Description
per-page integer N Total number of items on one page. Valid values: 1-1000. Value by default is 50
page integer N Page number.

Request body

Do not supply any properties with this method.

Response

Property name Value Description
id integer Language ID
title string Language name
code string Code in accordance with ISO 639-1
created_at string Date of creation the item of dictionary

Countries

Countries dictionary is based on ISO-3166

Request example

curl -X GET 'https://api.flime.com/v2/countries' \
  -H 'Content-Type: application/json'  \

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Parameters

Property name Value Required Description
per-page integer N Total number of items on one page. Valid values: 1-1000. Value by default is 50
page integer N Page number.

Request body

Do not supply any properties with this method.

Response

Property name Value Description
id integer Country ID
country_name string Country name
country_code string Code in accordance with ISO 3166
phone_code integer Phone code
jurisdiction object List of countries
jurisdiction.id integer Country ID
jurisdiction.title string Country name

Currency

Request example

curl -X GET \
  https://api.flime.com/v2/currencies \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1...0fQK8E' \
  -H 'Content-Type: application/json' \

Use this call to get a list of currencies.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Parameters

Property name Value Required Description
per-page integer N Total number of items on one page. Valid values: 1-1000. Value by default is 50
page integer N Page number.

Request body

Do not supply any properties with this method.

Response

Property name Value Description
id integer Currency ID
title string Currency name (short)
fractions integer Code of the country to which this currency belongs

Specialization

Request example

curl -X GET \
  'https://api.flime.com/v2/specialization' \
  -H 'Content-Type: application/json' \

Use this call to get a list of specializations.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Parameters

Property name Value Required Description
per-page integer N Total number of items on one page. Valid values: 1-1000. Value by default is 50
page integer N Page number.

Request body

Do not supply any properties with this method.

Response

Property name Value Description
id integer Specialization ID
title string Specialization name (rus)
title_en integer Specialization name (eng)
code string Specialization code

Types of taxes

Request example

curl -X GET \
  'https://api.flime.com/v2/freelancers-tax-types' \
  -H 'Content-Type: application/json' \

Use this call to get a list of taxes types for freelancers.

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Parameters

Property name Value Required Description
per-page integer N Total number of items on one page. Valid values: 1-1000. Value by default is 50
page integer N Page number.

Request body

Do not supply any properties with this method.

Response

Property name Value Description
id integer Taxes type ID
title string Taxes type name

Task types

Request example

curl -X GET \
    'https://api.flime.com/v2/task-types'
    -H 'Accept: application/json'
    -H 'Content-Type: application/json'  \

This dictionary contains methods of task creation in the system:

  1. CABINET - the task was created from our visual Cabinet (app.flime.com)
  2. API - the task was created by automated method (using the API)
  3. FILE_IMPORT - the task was created using the import method and uploading Excel file

Request

HTTP request

Authorization

This request need an authorization token in the header parameters (read more about authorization).

Parameters

Property name Value Required Description
per-page integer N Total number of items on one page. Valid values: 1-1000. Value by default is 50
page integer N Page number.

Request body

Do not supply any properties with this method.

Response

Property name Value Description
id integer Task type ID
title string Task type name