Create a new Dream.
POST/dreams
Create a new Dream.
Request
- application/json
Body
required
Dream details
dream
object
Represents how much money (in cents or the smallest currency subunit) the User wants to save to complete this Dream.
Possible values: [Dream
]
Default value: Dream
(Optional) Date before which the User wants to complete this Dream.
This is the owner of the dream
(Optional) GroupDream this Dream is a part of.
The Account connected to this Dream. It is not required to create a Dream, but must be added before any deposit can be made.
Responses
- 201
- 400
Dream created
- application/json
- Schema
- Example (from schema)
Schema
dream
object
Represents how much money (in cents or the smallest currency subunit) the User wants to save to complete this Dream.
(Optional) Date before which the User wants to complete this Dream.
Represents when the dream was completed
Current balance cents for dream
Represents when the dream was deleted
Current count of active savehacks
user
object
groupDream
object
(Optional) GroupDream this Dream is a part of.
account
object
Identifies the account where all money towards this dream is stored
{
"dream": {
"id": "844830a8-b845-4cbc-b79f-865cd8c8aa8e",
"targetCents": 102000,
"type": "Dream",
"expiresAt": "2006-01-02",
"achievedAt": "2006-01-02T15:04:05Z",
"name": "Trip to Japan",
"balanceCents": 12300,
"deletedAt": "2006-01-02T15:04:05Z",
"imageUrl": "https://images.com/photo-123-456",
"activeSavehacksCount": 2,
"user": {
"type": "string",
"id": "string",
"externalId": "string"
},
"groupDream": {
"type": "string",
"id": "string"
},
"account": {
"type": "string",
"id": "string",
"externalId": "string"
}
}
}
Bad request
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
errors
object[]
required
{
"errors": [
{
"field": "string",
"errors": [
"string"
]
}
]
}
{
"errors": [
{
"field": "dream.targetCents",
"errors": [
"can't be negative"
]
}
]
}