API & Developers

Create project logs with the API

Endpoint and authorization

POST /api/v1/projects/{project}/logs

The token must be assigned to {project}, have project_logs:create, and belong to a user who currently has a Developer or Admin role on that project.

Request fields

Send a JSON object containing:

  • change_type: required; added, changed, deprecated, removed, fixed, or security.

  • title: required string, up to 255 characters.

  • description: optional string, up to 5,000 characters.

  • metadata: optional JSON object for integration-specific data.

  • fingerprint: optional string, up to 255 characters and unique within the project.

  • occurred_at: optional valid date/time. DeployMonitor uses the request time when omitted.

DeployMonitor sets source to api and attributes the log to the token owner.

cURL example

curl --request POST "https://deploymonitor.com/api/v1/projects/45/logs" \
  --header "Authorization: Bearer ${DEPLOYMONITOR_TOKEN}" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{
    "change_type": "changed",
    "title": "WooCommerce plugin updated",
    "description": "WooCommerce updated from 8.0 to 8.1.",
    "metadata": {
      "component_type": "plugin",
      "component_name": "WooCommerce",
      "from_version": "8.0",
      "to_version": "8.1"
    },
    "fingerprint": "plugin:woocommerce:8.0:8.1",
    "occurred_at": "2026-08-19T18:30:00Z"
  }'

JavaScript example

const response = await fetch(
  'https://deploymonitor.com/api/v1/projects/45/logs',
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.DEPLOYMONITOR_TOKEN}`,
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      change_type: 'security',
      title: 'WordPress core security update applied',
      metadata: { component_type: 'core', to_version: '6.6.2' },
      fingerprint: 'core:wordpress:6.6.2',
      occurred_at: new Date().toISOString(),
    }),
  },
);

if (!response.ok) {
  throw new Error(await response.text());
}

const { data: projectLog } = await response.json();

PHP example

use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('DEPLOYMONITOR_TOKEN'))
    ->acceptJson()
    ->post('https://deploymonitor.com/api/v1/projects/45/logs', [
        'change_type' => 'fixed',
        'title' => 'Contact form issue fixed',
        'description' => 'Corrected failed form submissions.',
        'fingerprint' => 'fix:contact-form:2026-08-19',
        'occurred_at' => now()->toISOString(),
    ]);

$response->throw();

$projectLog = $response->json('data');

Successful response

A successful request returns 201 Created with the complete log resource inside data, including its ID, project ID, token-owner user ID, api source, timestamps, metadata, and fingerprint.

See API errors, rate limits, and fingerprints before adding automatic retries.