PHPackages                             motion-php/client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. motion-php/client

ActiveLibrary[API Development](/categories/api)

motion-php/client
=================

API client written in PHP for Motion

1.0.0(3y ago)83MITPHPPHP ^8.1.0

Since May 6Pushed 2y agoCompare

[ Source](https://github.com/motion-php/client)[ Packagist](https://packagist.org/packages/motion-php/client)[ GitHub Sponsors](https://github.com/adam-paterson)[ RSS](/packages/motion-php-client/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (2)Used By (0)

**Motion PHP** is a community maintained PHP API Client for interacting with [Motion API](https://docs.usemotion.com/docs/motion-rest-api/44e37c461ba67-motion-rest-api). Motion is an excellent calendar and project management application which uses AI to reschedule your time effectively. If you haven't heard of it yet, check it out at [usemotion.com](https://www.usemotion.com/).

 [![Motion PHP Example](https://raw.githubusercontent.com/motion-php/assets/main/img/example.png)](https://raw.githubusercontent.com/motion-php/assets/main/img/example.png)

 [![GitHub Workflow Status (main)](https://camo.githubusercontent.com/c2c64737d5f6a0ffe69969027951281628de6673fa630360f21d8b6222770308/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f74696f6e2d7068702f636c69656e742f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666f722d7468652d6261646765)](https://github.com/motion-php/client/actions) [![Packagist Version (including pre-releases)](https://camo.githubusercontent.com/1018e848ccc74a275f2e06ca9e668d8a95ecd5015320caff947b30a14e1b9958/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f74696f6e2d7068702f636c69656e743f696e636c7564655f70726572656c6561736573267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/motion-php/client) [![Packagist Downloads](https://camo.githubusercontent.com/6aa15f25335ca21ce396410bf62ea75b90513a33fed354108b923c8626825cfd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6f74696f6e2d7068702f636c69656e743f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/motion-php/client) [![GitHub](https://camo.githubusercontent.com/629bc06cb14030a36e552ea5d96c5b447670b55878547cb1a30e7c1f8c925c9b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f74696f6e2d7068702f636c69656e743f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/motion-php/client)

---

Table of Contents
-----------------

[](#table-of-contents)

- [Getting Started](#getting-started)
- [Usage](#usage)
    - [Tasks Resource](#tasks-resource)
    - [Recurring Tasks Resource](#recurring-tasks-resource)
    - [Workspaces Resource](#workspaces-resource)
    - [Users Resource](#users-resource)
    - [Projects Resource](#projects-resource)
    - [Schedules Resource](#schedule-resource)
- [Testing](#testing)

---

Getting Started
---------------

[](#getting-started)

> **Requires [PHP 8.1+](https://php.net/releases/)**
>
> **Requires [PSR-18 HTTP Client](https://packagist.org/providers/psr/http-client-implementation)**

Install the Motion PHP client using the [Composer](https://getcomposer.org/) package manager:

```
composer require motion-php/client
```

Make sure the `php-http/discovery` composer plugin is allowed to run or install a PSR-18 HTTP Client implementation manually if your project does not already have one.

```
composer require guzzlehttp/guzzle
```

Then you are ready to interact with the Motion API. To get started quickly, you can use the `Motion::client` factory method to create a client instance.

```
$apiKey = getenv('YOUR_API_KEY');

$client = Motion::client($apiKey);

$result = $client->task()->create([
    'name' => 'My Task',
    'description' => 'My Task Description',
    'status' => 'Completed',
]);

echo $result['task']['name']; // My Task
echo $result['task']['description']; // My Task Description
echo $result['task']['status']; // Completed
```

It is possible if you require to configure and provide a separate HTTP client using the `Motion::factory` method.

```
$apiKey = getenv('YOUR_API_KEY');

// PSR-18 HTTP Client
$httpClient = new GuzzleHttp\Client([]);

$client = Motion::factory()
    ->withApiKey($apiKey)
    ->withBaseUri('api.usemotion.com')
    ->withHttpClient($httpClient)
    ->withHttpHeader('X-My-Header', 'foo')
    ->withQueryParam('foo', 'bar')
    ->withStreamHandler(fn (RequestInterface $request): ResponseInterface => $client->send($request, [
        'stream' => true
    ]))
    ->make();
```

---

Usage
-----

[](#usage)

### Tasks resource

[](#tasks-resource)

#### `update` a task

[](#update-a-task)

Updates a task with the given `id` and properties. Returns a `Task` object.

`PATCH /tasks/{id}`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/a2b2ce881ce26-update-a-task)

```
$response = $client->tasks()->update('IF0lK9JcsdaxeLkDZ0nMG', [
    'name' => 'My Task',
    'description' => 'My Task Description',
    'status' => 'Completed',
]);

$task = $response->task; // Task object

$task->id; // IF0lK9JcsdaxeLkDZ0nMG
$task->name; // My Task
$task->description; // My Task Description
$task->project; // Project object

$task->toArray(); // ['id' => 'IF0lK9JcsdaxeLkDZ0nMG', ...]
```

#### `create` a task

[](#create-a-task)

Creates a task with the given properties. Returns a `Task` object.

`POST /tasks`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/0846d1205f9b3-create-task)

```
$response = $client->tasks()->create([
    'name' => 'My Task',
    'description' => 'My Task Description',
    'status' => 'Completed',
]);

$task = $response->task; // Task object

$task->id; // IF0lK9JcsdaxeLkDZ0nMG
$task->name; // My Task
$task->description; // My Task Description
$task->project; // Project object

$task->toArray(); // ['id' => 'IF0lK9JcsdaxeLkDZ0nMG', ...]
```

#### `delete` a task

[](#delete-a-task)

Deletes a task with the given `id`. Returns a `Task` object.

`DELETE /tasks/{id}`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/963b35f93846f-delete-a-task)

```
$response = $client->tasks()->delete('IF0lK9JcsdaxeLkDZ0nMG');
```

#### `retrieve` a task

[](#retrieve-a-task)

Retrieves a task with the given `id`. Returns a `Task` object.

`GET /tasks/{id}`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/3e8c65ed58693-retrieve-task)

```
$response = $client->tasks()->retrieve('IF0lK9JcsdaxeLkDZ0nMG');

$task = $response->task; // Task object

$task->id; // IF0lK9JcsdaxeLkDZ0nMG
$task->name; // My Task
$task->description; // My Task Description
$task->project; // Project object

$task->toArray(); // ['id' => 'IF0lK9JcsdaxeLkDZ0nMG', ...]
```

#### `move` task between workspaces

[](#move-task-between-workspaces)

Moves a task with the given `id` to a new workspace with the given `id`. Returns a `Task` object.

`POST /tasks/{id}/move`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/0440c0ba81f10-move-workspace)

```
$response = $client->tasks()->move('IF0lK9JcsdaxeLkDZ0nMG', 'IF0lK9JcsdaxeLkDZ0nMG');

$task = $response->task; // Task object

$task->id; // IF0lK9JcsdaxeLkDZ0nMG
$task->name; // My Task
$task->description; // My Task Description
$task->project; // Project object

$task->toArray(); // ['id' => 'IF0lK9JcsdaxeLkDZ0nMG', ...]
```

---

### `Recurring Tasks` resource

[](#recurring-tasks-resource)

#### `create` a recurring task

[](#create-a-recurring-task)

Creates a recurring task with the given properties. Returns a `RecurringTask` object.

`POST /recurring-tasks`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/41f447b4b598d-create-a-recurring-task)

```
$response = $client->recurringTasks()->create([
    'name' => 'My Task',
    'description' => 'My Task Description',
    'status' => 'Completed',
]);

$task = $response->task; // Task object

$task->id; // IF0lK9JcsdaxeLkDZ0nMG
$task->name; // My Task
```

#### `list` recurring tasks

[](#list-recurring-tasks)

Lists recurring tasks in a workspace. Returns an array of `RecurringTask` objects.

`GET /recurring-tasks`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/3caa7c537bb23-list-recurring-tasks)

```
$response = $client->recurringTasks()->list('workspaceId');

$tasks = $response->tasks; // array of Task objects
$meta = $response->meta; // Meta object

foreach ($tasks as $task) {
    $task->id; // IF0lK9JcsdaxeLkDZ0nMG
    $task->name; // My Task
    $task->project; // Project object
}

$meta->pageSize; // 20
$meta->nextCursor; // IF0lK9JcsdaxeLkDZ0nMG
```

#### `delete` a recurring task

[](#delete-a-recurring-task)

Deletes a recurring task with the given `id`. Returns an `id` string.

`DELETE /recurring-tasks/{id}`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/513aabc9f25c3-delete-recurring-tasks)

```
$response = $client->recurringTasks()->delete('IF0lK9JcsdaxeLkDZ0nMG');
```

### `Workspaces` resource

[](#workspaces-resource)

#### `list`

[](#list)

Lists workspaces for an organization.

`GET /workspaces`: 📖 [Documentation](https://docs.usemotion.com/docs/motion-rest-api/3caa7c537bb23-list-recurring-tasks)

```
$response = $client->workspaces()->list();

$response->workspaces; // array of Workspace objects

foreach ($response->workspaces as $workspace) {
    $workspace->id; // IF0lK9JcsdaxeLkDZ0nMG
    $workspace->name; // My Workspace
    $workspace->teamId; // 2f0lK9JcsdaxeLkDZ0nMG
    $workspace->statuses; // array of Status objects
    $workspace->labels; // array of Label objects
    $workspace->type; // INDIVIDUAL
}

$response->toArray(); // ['workspaces' => [...]]
```

#### `statuses`

[](#statuses)

List statuses for a workspace

```
$response = $client->workspaces()->statuses('IF0lK9JcsdaxeLkDZ0nMG');

$response->statuses; // array of Status objects

foreach ($response->statuses as $status) {
    $status->name; // In Progress
    $status->isDefaultStatus // true
    $status->isResolvedStatus // false
}

$response->toArray(); // ['statuses' => [...]]
```

### `Users` Resource

[](#users-resource)

#### `list`

[](#list-1)

Lists the currently available users. Can be limited by `teamId` or `workspaceId`.

```
$response = $client->users()->list([
    'workspaceId' => 'IF0lK9JcsdaxeLkDZ0nMG'
]);

$response->users; // array of User objects

foreach ($response->users as $user) {
    $user->id; // LPSIBmTN2eai9uYoKtMkzWVFTUo2
    $user->name; // Adam Paterson
    $user->email; // adam@usemotion.com
}

$response->toArray(); // ['users' => [...]]
```

Testing
-------

[](#testing)

```
$ composer test
```

Mock mode
---------

[](#mock-mode)

The client can be configured to run in mock mode. This will return mock responses for all requests. This is useful for testing. This can help with implementation without hitting the API and hitting rate limits.

```
$client = Motion::factory()
    ->withApiKey($apiKey)
    ->useMockMode(true)
    ->make();

$response = $client->tasks()->list();

$response->tasks; // array of Task objects
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1108d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/296c5969d49c166c45bbe6066cc3057d7279a1451f495186ac82de0de9455107?d=identicon)[Adam\_Paterson](/maintainers/Adam_Paterson)

---

Top Contributors

[![adam-paterson](https://avatars.githubusercontent.com/u/1008727?v=4)](https://github.com/adam-paterson "adam-paterson (32 commits)")

---

Tags

aicalendarphp-libraryphp8project-managementteam-collaboration

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/motion-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/motion-php-client/health.svg)](https://phpackages.com/packages/motion-php-client)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35636.1k2](/packages/telnyx-telnyx-php)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
