Projects

These endpoints allow you to manage your projects, including creating new projects and listing existing ones.

The project model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the project.

  • Name
    name
    Type
    string
    Description

    The name of the project.

  • Name
    description
    Type
    string
    Description

    Optional description of the project.

  • Name
    resources_count
    Type
    integer
    Description

    Number of resources associated with the project.

  • Name
    url
    Type
    string
    Description

    Optional URL associated with the project.

  • Name
    type
    Type
    integer
    Description

    Type of the project. See Project Types for possible values.

  • Name
    charge
    Type
    number
    Description

    Current charge for the project.

  • Name
    soft_limit
    Type
    number
    Description

    Soft limit for project resources.

  • Name
    hard_limit
    Type
    number
    Description

    Hard limit for project resources.

  • Name
    status
    Type
    integer
    Description

    Current status of the project. See Project Status for possible values.

  • Name
    used_at
    Type
    string
    Description

    Timestamp of last project usage.

  • Name
    created_at
    Type
    string
    Description

    Timestamp when the project was created.

  • Name
    updated_at
    Type
    string
    Description

    Timestamp when the project was last updated.

Project object

{
  "id": "9dc4c05e-0d00-41d7-8bb5-672497fa4173",
  "name": "First Test",
  "description": null,
  "resources_count": 0,
  "url": null,
  "type": 4,
  "charge": 0,
  "soft_limit": 0,
  "hard_limit": 0,
  "status": 0,
  "used_at": null,
  "created_at": "2024-12-20T08:34:25.000000Z",
  "updated_at": "2024-12-20T08:34:25.000000Z"
}

Project Types

Projects can be categorized into different types based on their purpose and nature. The type field in the project model accepts the following integer values:

  • Name
    WEB (0)
    Type
    Description

    Projects related to web development or web applications.

  • Name
    MOBILE (1)
    Type
    Description

    Mobile application development projects.

  • Name
    API (2)
    Type
    Description

    API development or integration projects.

  • Name
    GENERAL (4)
    Type
    Description

    General purpose projects. This is the default type.

  • Name
    SERVICE (5)
    Type
    Description

    Service-oriented projects or microservices.

  • Name
    LEARNING (6)
    Type
    Description

    Educational or learning-focused projects.

  • Name
    OTHER (9)
    Type
    Description

    Projects that don't fit into other categories.

Project Status

The status field indicates the current state of a project. Here are the possible values:

  • Name
    ACTIVE (0)
    Type
    success
    Description

    The project is active and operational. This is the default status.

  • Name
    ARCHIVED (1)
    Type
    warning
    Description

    The project has been archived and is no longer actively maintained.

  • Name
    SUSPENDED (2)
    Type
    danger
    Description

    The project has been suspended and is temporarily unavailable.


GET/my/projects

List projects

Retrieve a paginated list of all your projects. The results can be filtered and sorted using query parameters.

Query Parameters

  • Name
    page
    Type
    integer
    Description

    Page number for pagination. Starts from 1.

  • Name
    per_page
    Type
    integer
    Description

    Number of results per page (1-100). Default: 15.

  • Name
    search
    Type
    string
    Description

    Search projects by name or description. Maximum 255 characters.

  • Name
    type
    Type
    string
    Description

    Filter by project type. Multiple types can be comma-separated.

  • Name
    status
    Type
    string
    Description

    Filter by project status. Multiple statuses can be comma-separated.

  • Name
    date_from
    Type
    string
    Description

    Filter projects created from this date (YYYY-MM-DD).

  • Name
    date_to
    Type
    string
    Description

    Filter projects created until this date (YYYY-MM-DD). Must be after or equal to date_from.

  • Name
    sort_by
    Type
    string
    Description

    Sort results by field. Options: created_at, name, type, status, resources_count.

  • Name
    sort_direction
    Type
    string
    Description

    Sort direction. Options: asc, desc.

Request

GET
/my/projects
curl -X GET "https://api.tradevps.net/v1/my/projects?page=1&search=test&type=0,1&status=0&date_from=2024-01-01&date_to=2024-12-31&sort_by=created_at&sort_direction=desc&per_page=20" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}"

Response 200

{
  "ok": true,
  "msg": "Projects Fetched",
  "data": [
    {
      "id": "9dc35881-a8b0-47d5-b7a5-00674c4d22b3",
      "name": "First Test",
      "description": null,
      "resources_count": 0,
      "url": null,
      "type": null,
      "charge": 0,
      "soft_limit": null,
      "hard_limit": null,
      "status": 0,
      "used_at": null,
      "created_at": "2024-12-19T15:48:10.000000Z",
      "updated_at": "2024-12-19T15:48:10.000000Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 15,
    "total": 1,
    "first_page_url": "https://api.tradevps.net/v1/my/projects?page=1",
    "from": 1,
    "last_page_url": "https://api.tradevps.net/v1/my/projects?page=1",
    "links": {},
    "next_page_url": null,
    "prev_page_url": null
  }
}

POST/my/projects

Create project

Create a new project.

Required attributes

  • Name
    name
    Type
    string
    Description

    The name of the project. Must be between 3 and 255 characters.

Optional attributes

  • Name
    url
    Type
    string
    Description

    URL associated with the project. Must be between 3 and 255 characters if provided.

  • Name
    description
    Type
    string
    Description

    Description of the project. Must be between 3 and 255 characters if provided.

  • Name
    type
    Type
    integer
    Description

    Type of the project. Must be one of the valid Project Types.

  • Name
    soft_limit
    Type
    number
    Description

    Soft limit for project resources in US dollars (USD). Must be a non-negative number. When this limit is reached, notifications will be sent but resources will continue to function.

  • Name
    hard_limit
    Type
    number
    Description

    Hard limit for project resources in US dollars (USD). Must be a non-negative number. When this limit is reached, resource usage may be restricted or suspended.

Request

POST
/my/projects
curl -X POST https://api.tradevps.net/v1/my/projects \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Trading Project",
    "url": "https://trading.example.com",
    "description": "My trading automation project",
    "type": 4,
    "soft_limit": 1000,
    "hard_limit": 2000
  }'

Response 200

{
  "ok": true,
  "msg": "Project created",
  "data": {
    "id": "9dc4c05e-0d00-41d7-8bb5-672497fa4173",
    "name": "Trading Project",
    "description": "My trading automation project",
    "resources_count": 0,
    "url": "https://trading.example.com",
    "type": 4,
    "charge": 0,
    "soft_limit": 1000,
    "hard_limit": 2000,
    "status": 0,
    "used_at": null,
    "created_at": "2024-12-20T08:34:25.000000Z",
    "updated_at": "2024-12-20T08:34:25.000000Z"
  }
}

Response 422

{
  "message": "The given data was invalid.",
  "errors": {
    "name": [
      "The name field is required.",
      "The name must be at least 3 characters."
    ]
  }
}