### GET /api/v1/projects.json
Source: https://everii-group.github.io/mocoapp-api-docs/authentication
Example of fetching projects using an API key for authentication.
```APIDOC
## GET /api/v1/projects.json
### Description
Fetches a list of projects associated with the authenticated account.
### Method
GET
### Endpoint
`/api/v1/projects.json`
### Parameters
#### Headers
- **Authorization** (string) - Required - The API key for authentication. Format: `Token token=YOUR_API_KEY`
### Request Example
```bash
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/projects.json' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
### Response
#### Success Response (200)
- **projects** (array) - A list of project objects.
#### Response Example
(Example response not provided in source text)
```
--------------------------------
### Project Task Attributes Example (JSON)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/project_tasks
An example JSON object illustrating the structure and possible fields for a project task, including its ID, name, billing status, budget, rates, associated revenue category, and timestamps.
```json
{
"id": 760253573,
"name": "Projektleitung",
"billable": true,
"active": true,
"budget": 2900,
"hourly_rate": 120,
"revenue_category": {
"id": 126,
"name": "Projektleitung",
"revenue_account": 30058,
"cost_category": "PM1"
},
"description": "A task description",
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
```
--------------------------------
### MocoApp API: Example Catalog Service JSON
Source: https://everii-group.github.io/mocoapp-api-docs/sections/account/catalog_services
An example JSON structure representing a catalog service entry in the MocoApp API. It includes an ID, title, and an array of items, each with its own type, title, and pricing details.
```json
{
"id": 20370,
"title": "Catalog entry",
"items": [
{
"id": 113400,
"type": "item",
"title": "Setup",
"description": null,
"quantity": 0.0,
"unit": null,
"unit_price": 0.0,
"net_total": 1200.0,
"unit_cost": 0.0,
"optional": false,
"part": false,
"additional": false,
"revenue_category": {
"id": 124,
"name": "Hosting",
"revenue_account": 30056,
"cost_category": "HO1"
},
"created_at": "2022-06-16T12:24:30Z",
"updated_at": "2022-06-16T12:24:30Z"
},
{
"id": 76675,
"type": "item",
"title": "Consulting",
"description": null,
"quantity": 20.0,
"unit": "h",
"unit_price": 150.0,
"net_total": 3000.0,
"unit_cost": 0.0,
"optional": false,
"part": false,
"additional": false,
"revenue_category": {
"id": 127,
"name": "Consulting",
"revenue_account": 30059,
"cost_category": "CO1"
},
"created_at": "2022-06-16T12:24:30Z",
"updated_at": "2022-06-16T12:24:30Z"
}
],
"created_at": "2022-06-16T12:24:30Z",
"updated_at": "2022-06-16T12:24:30Z"
}
```
--------------------------------
### Project Attributes Example
Source: https://everii-group.github.io/mocoapp-api-docs/sections/projects
This JSON object represents the structure and example data for a project in MocoApp. It includes details such as ID, name, dates, billing information, associated customer, deal, tasks, and contracts. Note that `hourly_rate` and `billing_variant` have a linked relationship, affecting how rates are calculated for tasks or users.
```json
{
"id": 1234567,
"identifier": "P001",
"name": "Website Support",
"active": true,
"billable": true,
"fixed_price": true,
"retainer": false,
"start_date": null,
"finish_date": "2018-12-31",
"color": "#CCCC00",
"currency": "EUR",
"billing_variant": "project",
"billing_address": "Beispiel AG\nHerr Maier\nBeispielstrasse...",
"billing_email_to": "project@beispiel.co",
"billing_email_cc": "project-cc@beispiel.co",
"billing_notes": "Billig notes text",
"setting_include_time_report": true,
"budget": 18200,
"budget_monthly": null,
"budget_expenses": 8200,
"hourly_rate": 150,
"info": "Abrechnung jährlich",
"tags": ["Print", "Digital"],
"customer_report_url": "https://mycompany.mocoapp.com/projects/1234567/customer_report/cfd1901d23e000712488",
"custom_properties": {
"Project Management": "https://basecamp.com/123456"
},
"leader": {
"id": 933590696,
"firstname": "Michael",
"lastname": "Mustermann"
},
"co_leader": null,
"customer": {
"id": 1233434,
"name": "Beispiel AG"
},
"deal": {
"id": 5635453,
"name": "Website Relaunch"
},
"tasks": [
{
"id": 125112,
"name": "Project Management",
"billable": true,
"active": true,
"budget": null,
"hourly_rate": 0,
"description": "A task description"
},
{
"id": 125111,
"name": "Development",
"billable": true,
"active": true,
"budget": null,
"hourly_rate": 0,
"description": "A task description"
}
],
"contracts": [
{
"id": 458639048,
"user_id": 933590696,
"firstname": "Michael",
"lastname": "Mustermann",
"billable": true,
"active": true,
"budget": null,
"hourly_rate": 0
},
{
"id": 458672097,
"user_id": 933589591,
"firstname": "Nicola",
"lastname": "Piccinini",
"billable": true,
"active": true,
"budget": null,
"hourly_rate": 0
}
],
"project_group": {
"id": 456687,
"name": "Webpages"
},
"billing_contact": {
"id": 1234,
"firstname": "Maxine",
"lastname": "Muster"
},
"contact": {
"id": 2345,
"firstname": "Max",
"lastname": "Muster"
},
"secondary_contact": {
"id": 3456,
"firstname": "Meike",
"lastname": "Muster"
},
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
```
--------------------------------
### Example Presence Object Structure
Source: https://everii-group.github.io/mocoapp-api-docs/sections/presences
This JSON object represents the structure of a user presence record. It includes details such as the presence ID, date, start and end times, home office status, and associated user information. Created and updated timestamps are also provided.
```json
{
"id": 982237015,
"date": "2018-07-03",
"from": "07:30",
"to": "13:15",
"is_home_office": true,
"user": {
"id": 933590696,
"firstname": "John",
"lastname": "Doe"
},
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
```
--------------------------------
### GET /account/web_hooks
Source: https://everii-group.github.io/mocoapp-api-docs/sections/web_hooks
Retrieves a list of all configured web hooks.
```APIDOC
## GET /account/web_hooks
### Description
Retrieve all web hooks. This returns an array with complete web hooks information (see Attributes). Global filters may apply.
### Method
GET
### Endpoint
`/account/web_hooks`
### Parameters
#### Query Parameters
* **(No specific query parameters listed in the provided text)**
### Request Example
```bash
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/account/web_hooks' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
### Response
#### Success Response (200)
An array of web hook objects.
#### Response Example
```json
[
{
"id": 123,
"target": "Activity",
"event": "create",
"hook": "https://example.org/do-stuff",
"disabled": false,
"disabled_at": null,
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
]
```
```
--------------------------------
### Verify API Key Validity with Session GET (Curl)
Source: https://everii-group.github.io/mocoapp-api-docs/authentication
Illustrates how to verify if an API key is still valid by sending a GET request to the /api/v1/session endpoint. A successful verification returns a 200 OK status and session details.
```curl
curl https://{domain}.mocoapp.com/api/v1/session \
-H 'Accept: application/json' \
-H 'Content-Type: application/json'
```
--------------------------------
### Mocoapp API - Team Attributes Example
Source: https://everii-group.github.io/mocoapp-api-docs/sections/units
Provides an example JSON structure representing a team within the Mocoapp API. This includes the team's ID, name, assigned users, and creation/update timestamps. It serves as a reference for the data format returned by various team-related API calls.
```json
{
"id": 909147861,
"name": "C Office",
"users": [
{
"id": 933590158,
"firstname": "Tobias",
"lastname": "Miesel",
"email": "tobias@domain.com"
},
{
"id": 933589599,
"firstname": "Sabine",
"lastname": "Schäuble",
"email": "sabine@domain.com"
}
],
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
```
--------------------------------
### Get Offer PDF
Source: https://everii-group.github.io/mocoapp-api-docs/sections/offers
Retrieves a specific offer as a PDF document.
```APIDOC
## GET /offers/{id}.pdf
### Description
Retrieves a specific offer as a PDF document.
### Method
GET
### Endpoint
/offers/{id}.pdf
### Parameters
#### Path Parameters
- **id** (integer) - Required - The unique identifier of the offer.
### Request Example
None
### Response
#### Success Response (200)
- **PDF** - The offer document in PDF format.
#### Response Example
(Binary PDF data)
```
--------------------------------
### GET /offers/{offer_id}/attachments
Source: https://everii-group.github.io/mocoapp-api-docs/sections/offers
List all attachments for a given offer.
```APIDOC
## GET /offers/{offer_id}/attachments
### Description
List all attachments for this offer.
### Method
GET
### Endpoint
`/offers/{offer_id}/attachments`
### Parameters
#### Path Parameters
- **offer_id** (integer) - Required - The ID of the offer whose attachments are to be listed.
### Request Example
```bash
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/offers/{offer_id}/attachments' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
### Response
#### Success Response (200)
This endpoint does not explicitly define a success response body in the provided documentation. It is expected to return a list of attachments associated with the offer.
#### Response Example
(No specific example provided)
```
--------------------------------
### Recurring Expense Attributes Example
Source: https://everii-group.github.io/mocoapp-api-docs/sections/project_recurring_expenses
Provides an example JSON representation of a recurring expense entry. This includes details such as dates, period, pricing, associated project, and custom properties. This structure is used for GET requests and as a reference for POST/PUT operations.
```json
{
"id": 47266,
"start_date": "2017-07-01",
"finish_date": "2017-12-31",
"recur_next_date": "2017-09-01",
"period": "monthly",
"title": "Hosting XS",
"description": "
Hosting, Monitoring und Backup
",
"quantity": 1,
"unit": "Server",
"unit_price": 29,
"unit_cost": 19,
"price": 29,
"cost": 19,
"currency": "CHF",
"budget_relevant": true,
"billable": true,
"service_period_direction": "forward",
"custom_properties": {
"Type": "Website"
},
"project": {
"id": 1234,
"name": "Project A"
},
"revenue_category": {
"id": 124,
"name": "Hosting",
"revenue_account": 30056,
"cost_category": "HO1"
},
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
```
--------------------------------
### MOCO Webhook Example Headers
Source: https://everii-group.github.io/mocoapp-api-docs/webhooks
Illustrates the headers sent with a MOCO Webhook triggered by an activity creation event. These headers provide context for the payload, including target, event type, timestamp, signature, user ID, and account URL.
```text
X-Moco-Target: Activity
X-Moco-Event: create
X-Moco-Timestamp: 1527170410463
X-Moco-Signature: f457bffc50e9b63f455ab107c55f2f61956550aa5525c2cfe07f574014bd8a9e
X-Moco-User-Id: 933613686
```
--------------------------------
### Create Planning Entry (API)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/planning_entries
Creates a new planning entry. Requires either a project_id or deal_id, start and end dates, and hours per day. The user is assigned automatically if not specified. Supports optional fields like comment and symbol. Requires an API token and JSON content type.
```bash
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/planning_entries' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"project_id": 4322,
"task_id": 6789,
"starts_on": "2020-05-20",
"ends_on": "2020-05-30",
"hours_per_day": 3,
"comment": "A comment...",
"symbol": 2
}'
```
--------------------------------
### Retrieve Project's Recurring Expenses (GET /projects/{id}/recurring_expenses)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/project_recurring_expenses
This cURL example shows how to fetch all recurring additional services associated with a specific project. It uses the project's ID in the URL and requires an API token.
```curl
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/projects/{id}/recurring_expenses' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### POST /users/employments
Source: https://everii-group.github.io/mocoapp-api-docs/sections/employments
Create a new user employment. Requires user ID and pattern.
```APIDOC
## POST /users/employments
### Description
Create a new user employment. Requires user ID and pattern.
### Method
POST
### Endpoint
`/users/employments`
### Parameters
#### Request Body
- **user_id** (integer) - Required - The ID of the user to associate the employment with (e.g., 123).
- **pattern** (object) - Required - Defines the work hours during morning and afternoon on each workday.
- **am** (array) - Hours for morning shifts (e.g., `[0, 4.25, 4.25, 4.25, 4.25]`).
- **pm** (array) - Hours for afternoon shifts (e.g., `[0, 4.25, 4.25, 4.25, 0]`).
- **from** (string) - Optional - The date when the employment becomes effective (default: current date). Format: "YYYY-MM-DD".
- **to** (string) - Optional - The date when the employment stops being effective (default: unset). Format: "YYYY-MM-DD".
### Request Example
```json
{
"user_id": 123,
"pattern": {
"am": [0, 4.25, 4.25, 4.25, 4.25],
"pm": [0, 4.25, 4.25, 4.25, 0]
},
"from": "2022-01-01",
"to": "2022-12-31"
}
```
### Response
#### Success Response (201)
- **employment** (object) - The created employment object (structure similar to GET response).
#### Response Example
```json
{
"employment": {
"id": 982237016,
"weekly_target_hours": 29.75,
"pattern": {
"am": [0, 4.25, 4.25, 4.25, 4.25],
"pm": [0, 4.25, 4.25, 4.25, 0]
},
"from": "2022-01-01",
"to": "2022-12-31",
"user": {
"id": 123,
"firstname": "John",
"lastname": "Doe"
},
"created_at": "2023-01-01T10:00:00Z",
"updated_at": "2023-01-01T10:00:00Z"
}
}
```
```
--------------------------------
### Start Timer for Activity - cURL
Source: https://everii-group.github.io/mocoapp-api-docs/sections/activities
Starts or continues a timer for a specified activity. This operation is only available for activities on the current day. A 422 error will be returned if the timer cannot be started.
```curl
curl -X PATCH \
'https://{domain}.mocoapp.com/api/v1/activities/{id}/start_timer' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
```
--------------------------------
### Start or Stop Timer on Activity
Source: https://everii-group.github.io/mocoapp-api-docs/sections/activities
Endpoints to start, continue, or stop a timer associated with a specific activity.
```APIDOC
## PATCH /activities/{id}/start_timer
### Description
Start or continue a timer on an activity. The timer is only available for activities on the current day. If the timer cannot be started, a 422 error will be returned.
### Method
PATCH
### Endpoint
`/activities/{id}/start_timer`
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the activity to start the timer on.
### Request Example
```json
{
"message": "Example request body (if any)"
}
```
### Response
#### Success Response (200)
- **message** (string) - Indicates the timer was started or continued successfully.
#### Response Example
```json
{
"message": "Timer started successfully."
}
```
## PATCH /activities/{id}/stop_timer
### Description
Stop a timer running on an activity.
### Method
PATCH
### Endpoint
`/activities/{id}/stop_timer`
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the activity to stop the timer on.
### Request Example
```json
{
"message": "Example request body (if any)"
}
```
### Response
#### Success Response (200)
- **message** (string) - Indicates the timer was stopped successfully.
#### Response Example
```json
{
"message": "Timer stopped successfully."
}
```
```
--------------------------------
### Contact Attributes Example (JSON)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/contacts
An example JSON object representing the attributes of a contact, including standard fields, tags, and company information.
```json
{
"id": 123,
"gender": "M",
"firstname": "Peter",
"lastname": "Muster",
"title": "Dr. med.",
"job_position": "Account Manager",
"mobile_phone": "+41 123 45 67",
"work_fax": "",
"work_phone": "+41 445 45 67",
"work_email": "peter.muster@beispiel.ch",
"work_address": "Beispiel AG\nPeter Muster\nBeispielstrasse 123",
"home_email": "",
"home_address": "",
"birthday": "1959-05-22",
"info": "",
"avatar_url": "https//meinefirma.mocoapp.com/.../profil.jpg",
"tags": ["Key Account", "Christmas Card"],
"company": {
"id": 123456,
"type": "customer",
"name": "Beispiel AG"
},
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
```
--------------------------------
### POST /projects
Source: https://everii-group.github.io/mocoapp-api-docs/sections/projects
Create a new project.
```APIDOC
## POST /projects
### Description
Create a new project.
### Method
POST
### Endpoint
/api/v1/projects
### Parameters
#### Request Body
- **name** (string) - Required - The name of the project.
- **customer_id** (integer) - Required - The ID of the customer to associate with the project.
- **active** (boolean) - Optional - Whether the project is active (default: true).
- **billable** (boolean) - Optional - Whether the project is billable (default: true).
- **fixed_price** (boolean) - Optional - Whether the project has a fixed price (default: false).
- **retainer** (boolean) - Optional - Whether the project is a retainer (default: false).
- **start_date** (date) - Optional - The start date of the project (YYYY-MM-DD).
- **finish_date** (date) - Optional - The finish date of the project (YYYY-MM-DD).
- **color** (string) - Optional - Hexadecimal color code for the project (e.g., "#CCCC00").
- **currency** (string) - Optional - Currency code (e.g., "EUR").
- **billing_variant** (string) - Optional - Billing variant ('project', 'task', or 'user').
- **billing_address** (string) - Optional - Billing address.
- **billing_email_to** (string) - Optional - Email address for billing.
- **billing_email_cc** (string) - Optional - CC email address for billing.
- **billing_notes** (string) - Optional - Notes for billing.
- **setting_include_time_report** (boolean) - Optional - Whether to include time reports (default: false).
- **budget** (number) - Optional - The project budget.
- **budget_monthly** (number) - Optional - The monthly budget.
- **budget_expenses** (number) - Optional - The budget for expenses.
- **hourly_rate** (number) - Optional - The hourly rate for the project.
- **info** (string) - Optional - Additional information about the project.
- **tags** (array of strings) - Optional - Tags associated with the project.
- **custom_properties** (object) - Optional - Custom properties for the project.
- **leader_id** (integer) - Optional - The ID of the project leader.
- **project_group_id** (integer) - Optional - The ID of the project group.
- **deal_id** (integer) - Optional - The ID of the associated deal.
### Request Example
```json
{
"name": "New Website Project",
"customer_id": 1233434,
"start_date": "2023-01-01",
"hourly_rate": 100,
"tags": ["Web", "Development"]
}
```
### Response
#### Success Response (200)
Returns the newly created project object.
```
--------------------------------
### Get All Planning Entries (API)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/planning_entries
Retrieves a paginated list of all planning entries. Supports filtering by period, user ID, project ID, and deal ID. Requires an API token for authorization.
```bash
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/planning_entries?period=2020-04-01:2020-07-31' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### GET /profile
Source: https://everii-group.github.io/mocoapp-api-docs/sections/profile
Retrieves the current user's profile information. This includes details like ID, email, name, avatar URL, and associated unit. If impersonation is enabled, the profile of the impersonated user is returned.
```APIDOC
## GET /profile
### Description
Get the current user’s profile. If impersonation is used, it’s the impersonated user.
### Method
GET
### Endpoint
/profile
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```bash
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/profile' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
### Response
#### Success Response (200)
- **id** (integer) - The unique identifier of the user.
- **email** (string) - The email address of the user.
- **full_name** (string) - The full name of the user.
- **first_name** (string) - The first name of the user.
- **last_name** (string) - The last name of the user.
- **active** (boolean) - Indicates if the user account is active.
- **external** (boolean) - Indicates if the user is an external user.
- **avatar_url** (string) - The URL to the user's avatar image.
- **unit** (object) - Information about the user's unit.
- **id** (integer) - The unique identifier of the unit.
- **name** (string) - The name of the unit.
- **created_at** (string) - The timestamp when the user was created (ISO 8601 format).
- **updated_at** (string) - The timestamp when the user was last updated (ISO 8601 format).
#### Response Example
```json
{
"id": 237852983,
"email": "janine.kuesters@meinefirma.de",
"full_name": "Janine Küsters",
"first_name": "Janine",
"last_name": "Küsters",
"active": true,
"external": false,
"avatar_url": "https://data.mocoapp.com/objects/6bf3db0a-895a-46a1-8006-6280af04b9c0.jpg",
"unit": {
"id": 436796,
"name": "Design"
},
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2022-08-02T14:21:56Z"
}
```
```
--------------------------------
### Task Template Attributes Example
Source: https://everii-group.github.io/mocoapp-api-docs/sections/account/task_templates
This JSON object demonstrates the structure and attributes of a task template. It includes fields such as name, description, revenue category, billable status, project default, and index.
```json
{
"id": 1,
"name": "Service A",
"description": "A description",
"revenue_category": {
"id": 4567,
"name": "Revenue category name",
"revenue_account": 1000,
"cost_category": 99
},
"billable": true,
"project_default": true,
"index": 10,
"created_at": "2025-07-17T18:14:31Z",
"updated_at": "2022-08-18T08:17:55Z"
}
```
--------------------------------
### Retrieve Offer Customer Approval (GET)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/offer_customer_approval
Fetches the customer approval status for a given offer. Requires the offer ID and an API key for authorization. Returns approval details or a 404 if not activated. The `signed_at` field indicates if approval was granted.
```curl
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/offers/{id}/customer_approval' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### Create Lead (curl)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/deals
Uses `curl` to send a POST request to the Mocoapp API to create a new lead. Requires mandatory fields like name, currency, money, reminder_date, user_id, and deal_category_id. Optional fields like company_id, person_id, info, status, closed_on, service periods, and tags can also be provided.
```bash
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/deals' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Beispiel AG Website Relaunch",
"currency": "EUR",
"money": 25000,
"reminder_date": "2018-12-01",
"user_id": 123,
"deal_category_id": 456,
}'
```
--------------------------------
### MocoApp API - Get All Purchase Drafts (curl)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/purchase_drafts
Retrieves a list of all purchase drafts using a GET request to the MocoApp API. Requires an authorization token. The response is an array containing complete draft information as defined in the attributes.
```curl
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/purchases/drafts' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### Get Current User Profile (cURL)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/profile
Retrieves the current user's profile information from the Mocoapp API. This endpoint returns details such as user ID, email, name, and associated unit. It requires an API token for authorization.
```bash
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/profile' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### Payment Schedule Attributes Example
Source: https://everii-group.github.io/mocoapp-api-docs/sections/project_payment_schedules
Illustrates the structure of a payment schedule object, including its ID, date, title, description, total amount, associated project details, and billing/checked status.
```json
{
"id": 760153573,
"date": "2017-04-05",
"title": "Erste Anzahlung",
"description": "A description for this payment schedule
",
"net_total": 1000,
"project": {
"id": 822322322,
"identifier": "P0077",
"name": "New website"
},
"checked": false,
"billed": false,
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
```
--------------------------------
### Company Attributes Example
Source: https://everii-group.github.io/mocoapp-api-docs/sections/companies
Provides an example JSON structure for a company object, detailing its attributes like ID, type, name, contact information, billing details, tags, custom properties, and associated projects. This serves as a reference for data representation.
```json
{
"id": 760253573,
"type": "customer",
"name": "Beispiel AG",
"website": "www.beispiel-ag.com",
"email": "info@beispiel-ag.com",
"billing_email_cc": "cc@beispiel-ag.com",
"phone": "+49 30 123 45 67",
"fax": "+49 30 123 45 66",
"address": "Beispiel AG\nBeispielstrasse 123\n12345 Beispielstadt",
"tags": ["Netzwerk", "Druckerei"],
"user": {
"id": 933589840,
"firstname": "Tobias",
"lastname": "Miesel"
},
"info": "",
"custom_properties": {
"UID": "1234-UID-4567"
},
"identifier": "36",
"intern": false,
"billing_tax": 0,
"customer_vat": { "tax": 0.0, "reverse_charge": true, "intra_eu": true, "active": true, "print_gross_total": true, "notice_tax_exemption": "", "notice_tax_exemption_alt": "" },
"supplier_vat": { "tax": 0.0, "reverse_charge": true, "intra_eu": true, "active": true },
"currency": "CHF",
"custom_rates": false,
"include_time_report": false,
"billing_notes": "Vor Rechnungsstellung PO beantragen.",
"default_discount": 0.0,
"default_cash_discount": 2.0,
"default_cash_discount_days": 10,
"country_code": "CH",
"vat_identifier": "CH999999999",
"alternative_correspondence_language": false,
"default_invoice_due_days": 30,
"footer": "Footer text
",
"projects": [
{
"id": 944504145,
"identifier": "46",
"name": "Layoutanpassung",
"active": false,
"billable": true
}
],
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z",
"debit_number": 10000
}
```
--------------------------------
### Expense Template JSON Structure (Example)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/account/expense_templates
An example of the JSON object representing an expense template, detailing its attributes such as ID, title, description, unit, pricing, currency, and associated revenue category. This structure is used for both retrieving and creating/updating templates.
```json
{
"id": 1,
"title": "Hosting L",
"description": "The large hosting package",
"unit": "month",
"unit_price": "50.0",
"unit_cost": "40.0",
"currency": "EUR",
"revenue_category": {
"id": 124,
"name": "Hosting",
"revenue_account": 30056,
"cost_category": "HO1"
},
"created_at": "2022-09-17T18:14:31Z",
"updated_at": "2022-06-24T08:17:55Z"
}
```
--------------------------------
### Create Invoice using cURL
Source: https://everii-group.github.io/mocoapp-api-docs/sections/invoices
This snippet demonstrates how to create a new invoice using a cURL request. It includes mandatory fields like customer_id, recipient_address, date, due_date, title, tax, currency, and items. Optional fields such as project_id, internal_contact_id, and custom properties can also be included. The 'items' array allows for detailed line items with quantities, units, prices, or references to activities and expenses.
```curl
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/invoices' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": 123456,
"project_id": 654321,
"recipient_address": "Mein Kunde\nHauptstrasse 1\n8000 Zürich",
"date": "2018-09-17",
"due_date": "2018-10-16",
"title": "Invoice",
"tax": 8.0,
"currency": "CHF",
"service_period_from": "2019-12-01",
"service_period_to": "2019-12-31",
"internal_contact_id": 1234,
"items": [
{
"type": "title",
"title": "Hours"
},
{
"type": "description",
"description": "Listing of all hours"
},
{
"type": "item",
"title": "Hosting",
"quantity": 1,
"unit": "Stk",
"unit_price": 99.0
},
{
"type": "separator"
},
{
"type": "item",
"title": "Design",
"quantity": 3,
"unit": "h",
"unit_price": 150.0
},
{
"type": "item",
"title": "Setup MailChimp (pauschal)",
"net_total": 400.00
}
]
}'
```
--------------------------------
### MocoApp API - Get Single Purchase Draft by ID (curl)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/purchase_drafts
Fetches a specific purchase draft by its unique identifier using a GET request to the MocoApp API. Requires an authorization token. The response provides the detailed representation of the single draft.
```curl
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/purchases/drafts/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### Create Project
Source: https://everii-group.github.io/mocoapp-api-docs/sections/projects
Creates a new project in MocoApp. This endpoint requires a JSON payload containing mandatory fields such as 'name', 'currency', 'start_date', 'finish_date', 'fixed_price' or 'retainer', 'leader_id', 'customer_id', and optionally 'identifier'. Specific fields become mandatory if 'retainer' is set to true. An authorization token and 'Content-Type' header are required.
```curl
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/projects' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{ \
"name": "Website Relaunch", \
"currency": "EUR", \
"leader_id": "1234", \
"customer_id": "5678", \
"tags": ["Print", "Digital"], \
}'
```
--------------------------------
### GET /invoices/{id}/expenses
Source: https://everii-group.github.io/mocoapp-api-docs/sections/invoices
Retrieve all expenses that were invoiced in a particular invoice.
```APIDOC
## GET /invoices/{id}/expenses
### Description
Retrieve all expenses that were invoiced in a particular invoice.
### Method
GET
### Endpoint
`/invoices/{id}/expenses`
### Parameters
#### Path Parameters
- **id** (integer) - Required - The ID of the invoice.
### Response
#### Success Response (200)
- Returns a list of expenses associated with the invoice.
#### Response Example
```json
[
{
"id": 47266,
"date": "2017-07-07",
"title": "Hosting XS",
"description": "Hosting, Monitoring und Backup
",
"quantity": 3,
"unit": "Monat",
"unit_price": 29,
"unit_cost": 19,
"price": 87,
"cost": 57,
"currency": "CHF",
"budget_relevant": true,
"billable": true,
"billed": false,
"recurring_expense_id": null,
"service_period": "10/2020",
"service_period_from": "2020-10-01",
"service_period_to": "2020-10-31",
"file_url": "https//meinefirma.mocoapp.com/.../beleg1.jpg",
"custom_properties": {
"Type": "Website"
},
"company": {
"id": 1234,
"name": "Acme Corp."
},
"project": {
"id": 1234,
"name": "Project A"
},
"purchase_id": 123456,
"purchase_item_id": 234567,
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
]
```
```
--------------------------------
### POST /account/web_hooks
Source: https://everii-group.github.io/mocoapp-api-docs/sections/web_hooks
Creates a new web hook.
```APIDOC
## POST /account/web_hooks
### Description
Create a new web hook with specified target, event, and hook URL.
### Method
POST
### Endpoint
`/account/web_hooks`
### Parameters
#### Request Body
* **target** (string) - Required - The type of event to listen for (e.g., "Activity", "Company", "Contact", "Project", "Invoice", "Offer", "Deal", "Expense").
* **event** (string) - Required - The specific event action (e.g., "create", "update", "delete").
* **hook** (string) - Required - The URL endpoint where the webhook data will be sent.
### Request Example
```json
{
"target": "Activity",
"event": "create",
"hook": "https://example.org/do-stuff"
}
```
### Response
#### Success Response (201)
Returns the newly created web hook object.
#### Response Example
```json
{
"id": 124,
"target": "Activity",
"event": "create",
"hook": "https://example.org/do-stuff",
"disabled": false,
"disabled_at": null,
"created_at": "2023-10-27T10:00:00Z",
"updated_at": "2023-10-27T10:00:00Z"
}
```
```
--------------------------------
### MocoApp API - Get Purchase Draft Document as PDF (curl)
Source: https://everii-group.github.io/mocoapp-api-docs/sections/purchase_drafts
Downloads the document associated with a specific purchase draft in PDF format using a GET request to the MocoApp API. Requires an authorization token. If the document is not a PDF, a 204 No Content status is returned.
```curl
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/purchases/drafts/{id}.pdf' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### Retrieve Projects - cURL Example
Source: https://everii-group.github.io/mocoapp-api-docs/sections/projects
This cURL command demonstrates how to retrieve a list of all projects using the MocoApp API. It requires an API token for authorization and can accept various query parameters for filtering the results. The response is an array of project objects, detailed in the Attributes section.
```curl
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/projects' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
--------------------------------
### GET /invoices/{id}/attachments
Source: https://everii-group.github.io/mocoapp-api-docs/sections/invoices
Retrieves a list of all attachments associated with a specific invoice.
```APIDOC
## GET /invoices/{id}/attachments
### Description
List all attachments for this invoice.
### Method
GET
### Endpoint
`/api/v1/invoices/{invoice_id}/attachments`
### Parameters
#### Path Parameters
- **invoice_id** (integer) - Required - The ID of the invoice to retrieve attachments for.
#### Query Parameters
None
#### Request Body
None
### Request Example
(No request body)
### Response
#### Success Response (200)
- **attachments** (array) - A list of attachments for the invoice.
- Each attachment object may contain details such as filename, size, and MIME type.
#### Response Example
```json
[
{
"id": 1,
"filename": "document.pdf",
"content_type": "application/pdf",
"size": 102400
}
]
```
```
--------------------------------
### Create User Employment
Source: https://everii-group.github.io/mocoapp-api-docs/sections/employments
Creates a new user employment record. Requires user ID, pattern, and start date. An end date can also be provided. Authorization is handled via an API key and content type must be JSON.
```curl
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/users/employments' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"user_id": 123,
"pattern": {
"am": [0, 4.25, 4.25, 4.25, 4.25],
"pm": [0, 4.25, 4.25, 4.25, 0]
},
"from": "2022-01-01",
"to": "2022-12-31"
}'
```
--------------------------------
### GET /projects/{id}
Source: https://everii-group.github.io/mocoapp-api-docs/sections/projects
Retrieve a specific project by its ID.
```APIDOC
## GET /projects/{id}
### Description
Retrieve a specific project by its ID.
### Method
GET
### Endpoint
/api/v1/projects/{id}
### Parameters
#### Path Parameters
- **id** (integer) - Required - The unique identifier of the project.
### Request Example
```bash
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/projects/1234567' \
-H 'Authorization: Token token=YOUR_API_KEY'
```
### Response
#### Success Response (200)
Returns a single project object with all its details.
```