R4

Create Project

Creates a new project in your organization.

POST /api/v1/machine/project

Headers

HeaderTypeRequiredDescription
X-API-KeystringYesYour API key
Content-TypestringYesMust be application/json

Request Body

FieldTypeRequiredDescription
namestringYesThe name of the project (max 255 characters)
externalIdstringNoOptional external identifier for integration (max 255 characters)
descriptionstringNoA description of the project (max 1000 characters)

Example Request Body

{
  "name": "Production Infrastructure",
  "externalId": "PROJ-001",
  "description": "Contains all production environment resources"
}

Response

Success (201 Created)

{
  "id": "507f1f77bcf86cd799439014"
}

Response Fields

FieldTypeDescription
idstringThe unique identifier of the newly created project

Error Responses

400 Bad Request - Invalid request body

{
  "error": {
    "code": "project_creation_failed",
    "message": "Failed to create the project. Please verify your input and try again."
  }
}

401 Unauthorized - Invalid or missing API key

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key. Please provide your API key in the X-API-Key header."
  }
}

Example Request

curl -X POST "https://r4.dev/api/v1/machine/project" \
  -H "X-API-Key: rk_abc123def456.ghijklmnopqrstuvwxyz1234567890abcdef" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New Project",
    "externalId": "PROJ-003",
    "description": "A new project for the team"
  }'

Use Cases

  • Automated provisioning: Create projects as part of CI/CD pipelines
  • Bulk setup: Programmatically create multiple projects for new teams or environments
  • Integration: Create projects when triggered by external project management systems
  • Self-service: Enable automated project creation through internal portals

Notes

  • The project will be created in the tenant associated with your API key
  • Project names do not need to be unique within an organization
  • The externalId field is useful for linking projects to external systems (e.g., Jira, GitHub)