This resource allows clients to create, read, update, and delete voyage events for specific voyages. Voyage events represent different activities or milestones that occur during a voyage.
Returns all voyage events for a specific voyage with pagination actions at the beginning of response.
| Code | Description |
|---|---|
| 404 | Not found. |
| 422 | Unprocessable Entity. |
| 500 | Internal Server Error. |
# Get all voyage events (default: page 1, 25 per page) # Response includes 'actions' object with pagination URLs for easy navigation curl 'https://app.octopi.co/api/v1/voyages/V001/voyage_events' \ -X 'GET' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Token token=YOURTOKEN' # Get 100 events per page (maximum allowed) curl 'https://app.octopi.co/api/v1/voyages/V001/voyage_events?per_page=100' \ -X 'GET' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Token token=YOURTOKEN' # Get specific page with custom per_page curl 'https://app.octopi.co/api/v1/voyages/V001/voyage_events?page=2&per_page=50' \ -X 'GET' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Token token=YOURTOKEN'
{
"actions": {
"previous": {
"url": "https://app.octopi.co/api/v1/voyages/V001/voyage_events?page=0",
"method": "GET"
},
"next": {
"url": "https://app.octopi.co/api/v1/voyages/V001/voyage_events?page=2",
"method": "GET"
},
"last": {
"url": "https://app.octopi.co/api/v1/voyages/V001/voyage_events?page=3",
"method": "GET"
},
"index": {
"url": "https://app.octopi.co/api/v1/voyages/V001/voyage_events",
"method": "GET"
}
},
"voyage": {
"id": 123,
"voyage_number": "V001",
"vessel_name": "MSC LORETO"
},
"voyage_events": [
{
"id": 1,
"event_name": "Pilot Boarded",
"event_type_id": 5,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"started_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T11:00:00Z",
"custom_value": null,
"service_boat": {
"id": 2,
"name": "Pilot Boat Alpha"
},
"pilot": {
"id": 3,
"name": "John Smith"
},
"user": {
"id": 4,
"name": "Jane Doe"
},
"notes": "Pilot boarding completed successfully"
},
{
"id": 2,
"event_name": "Vessel Berthing",
"event_type_id": 3,
"created_at": "2024-01-15T11:15:00Z",
"updated_at": "2024-01-15T11:15:00Z",
"started_at": "2024-01-15T11:15:00Z",
"completed_at": "2024-01-15T11:45:00Z",
"custom_value": null,
"service_boat": null,
"pilot": {
"id": 3,
"name": "John Smith"
},
"user": {
"id": 4,
"name": "Jane Doe"
},
"notes": "Vessel successfully berthed at terminal"
}
]
}
| Param name | Description |
|---|---|
|
voyage_number required |
The voyage number to retrieve events for Validations:
|
|
page optional |
Page number for pagination Validations:
|
|
per_page optional |
Number of items per page (max 100) Validations:
|
Creates a new voyage event for a specific voyage.
| Code | Description |
|---|---|
| 404 | Not found. |
| 422 | Unprocessable Entity. |
| 500 | Internal Server Error. |
curl 'https://app.octopi.co/api/v1/voyages/V001/voyage_events' \
-X 'POST' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Token token=YOURTOKEN' \
-d '{
"voyage_event_type_id": 5,
"voyage_event": {
"started_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T11:00:00Z",
"service_boat_id": 2,
"pilot_id": 3,
"notes": "Pilot boarding completed successfully"
}
}'
{
"voyage_event": {
"id": 1,
"event_name": "Pilot Boarded",
"event_type_id": 5,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"started_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T11:00:00Z",
"custom_value": null,
"service_boat": {
"id": 2,
"name": "Pilot Boat Alpha"
},
"pilot": {
"id": 3,
"name": "John Smith"
},
"user": {
"id": 4,
"name": "Jane Doe"
},
"notes": "Pilot boarding completed successfully"
}
}
| Param name | Description |
|---|---|
|
voyage_number required |
The voyage number to create the event for Validations:
|
|
voyage_event_type_id required |
The voyage event type ID Validations:
|
|
voyage_event required |
Validations:
|
|
voyage_event[started_at] optional |
Start time in ISO 8601 format Validations:
|
|
voyage_event[completed_at] optional |
Completion time in ISO 8601 format Validations:
|
|
voyage_event[service_boat_id] optional |
Service boat ID Validations:
|
|
voyage_event[pilot_id] optional |
Pilot ID Validations:
|
|
voyage_event[from_berth_id] optional |
From berth area ID Validations:
|
|
voyage_event[to_berth_id] optional |
To berth area ID Validations:
|
|
voyage_event[custom_value] optional |
Custom value for the event Validations:
|
|
voyage_event[notes] optional |
Additional notes Validations:
|
Updates an existing voyage event.
| Code | Description |
|---|---|
| 404 | Not found. |
| 422 | Unprocessable Entity. |
| 500 | Internal Server Error. |
curl 'https://app.octopi.co/api/v1/voyages/V001/voyage_events/1' \
-X 'PATCH' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Token token=YOURTOKEN' \
-d '{
"voyage_event": {
"started_at": "2024-01-15T10:35:00Z",
"completed_at": "2024-01-15T11:05:00Z",
"notes": "Updated pilot boarding information"
}
}'
{
"voyage_event": {
"id": 1,
"event_name": "Pilot Boarded",
"event_type_id": 5,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:36:00Z",
"started_at": "2024-01-15T10:35:00Z",
"completed_at": "2024-01-15T11:05:00Z",
"custom_value": null,
"service_boat": {
"id": 2,
"name": "Pilot Boat Alpha"
},
"pilot": {
"id": 3,
"name": "John Smith"
},
"user": {
"id": 4,
"name": "Jane Doe"
},
"notes": "Updated pilot boarding information"
}
}
| Param name | Description |
|---|---|
|
voyage_number required |
The voyage number that owns this event Validations:
|
|
id required |
The voyage event ID Validations:
|
|
voyage_event required |
Validations:
|
|
voyage_event[started_at] optional |
Start time in ISO 8601 format Validations:
|
|
voyage_event[completed_at] optional |
Completion time in ISO 8601 format Validations:
|
|
voyage_event[service_boat_id] optional |
Service boat ID Validations:
|
|
voyage_event[pilot_id] optional |
Pilot ID Validations:
|
|
voyage_event[from_berth_id] optional |
From berth area ID Validations:
|
|
voyage_event[to_berth_id] optional |
To berth area ID Validations:
|
|
voyage_event[custom_value] optional |
Custom value for the event Validations:
|
|
voyage_event[notes] optional |
Additional notes Validations:
|
Deletes a specific voyage event.
| Code | Description |
|---|---|
| 404 | Not found. |
| 422 | Unprocessable Entity. |
| 500 | Internal Server Error. |
curl 'https://app.octopi.co/api/v1/voyages/V001/voyage_events/1' \ -X 'DELETE' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Token token=YOURTOKEN'
{
"message": "Voyage event deleted successfully"
}
| Param name | Description |
|---|---|
|
voyage_number required |
The voyage number that owns this event Validations:
|
|
id required |
The voyage event ID Validations:
|