Card layouts
This object represents a card layout in Recall. Card layouts define how fields are displayed in a card. There can be at most 5 card layouts per deck.
Endpoints
POST /v1/card_layouts # Create a new card layoutPOST /v1/card_layouts/:id # Update a card layoutGET /v1/card_layouts # List all card layoutsGET /v1/card_layouts/:id # Get a card layoutDELETE /v1/card_layouts/:id # Delete a card layout
The card layout object
{"id": "layout_yT9ktMcdzg4e","object": "card_layout","created_at": "2021-01-01T00:00:00Z","deck_id": "deck_5gvuzRdHW2ac","is_primary": true,"is_active": true,}
id stringThe ID of the card layout.
object string, value is "card_layout"The type of object.
An array of the card layout fields objects belonging to the card layout. Only included in the response if the expand parameter includes card_layout_fields.
created_at stringThe date and time the card layout was created. RFC 3339–formatted UTC datetime.
deck_id stringThe ID of the deck the card layout belongs to.
is_primary booleanWhether the card layout is the primary card layout of the deck. The primary card layout is the default layout used to display your cards. It can't be deleted.
When you set a layout to be primary, it will first verify that all the cards have at least a value in the front side of the card. If not, the request will fail and return an error. If it succeeds, the layout will be set as primary and other layouts will be set as not primary.
is_active booleanWhether the card layout is currently being used to display cards in reviews.
Create a card layout
curl https://api.recall.cards/v1/card_layouts \-u YOUR_API_KEY: \-H "Content-Type: application/json" \-d '{"deck_id": "deck_5gvuzRdHW2ac","is_active": true,}'
deck_id string requiredThe ID of the deck the card layout belongs to.
is_primary boolean, default is falseWhether the card layout is the primary card layout of the deck. The primary card layout is the default layout used to display your cards. It can't be deleted.
When you create a primary layout, it will first verify that all the cards have at least a value in the front side of the card. If not, the request will fail and return an error. If it succeeds, the layout will be set as primary and other layouts will be set as not primary.
is_active boolean, default is trueWhether the card layout should be used to display cards in reviews.
Returns
Returns the created card layout object.
Update a card layout
curl https://api.recall.cards/v1/card_layouts/layout_yT9ktMcdzg4e \-u YOUR_API_KEY: \-H "Content-Type: application/json" \-d '{"is_active": false,}'
is_primary boolean, default is falseWhether the card layout is the primary card layout of the deck. The primary card layout is the default layout used to display your cards. It can't be deleted.
When you update a primary layout, it will first verify that all the cards have at least a value in the front side of the card. If not, the request will fail and return an error. If it succeeds, the layout will be set as primary and other layouts will be set as not primary.
is_active boolean, default is trueWhether the card layout should be used to display cards in reviews.
Returns
Returns the updated card layout object.
List all card layouts
curl https://api.recall.cards/v1/card_layouts \-u YOUR_API_KEY: \-d '{"deck_id": "deck_5gvuzRdHW2ac"}'
deck_id stringFilter the card layouts by the ID of the deck the card layout belongs to.
limit optional, default is 10The maximum number of card layouts to return, ranging between 1 and 100.
starting_after optionalA cursor to use in pagination. starting_after is an object ID that defines your place in the list. For example, if you make a card list request and receive 100 cards, ending with card_2sdInOpM83eo, your subsequent call can include starting_after=card_2sdInOpM83eo to fetch the next page of the list.
ending_before optionalA cursor to use in pagination. Similarly to starting_after, ending_before is an object ID that allows you to fetch object in the previous page of the list.
Returns
{"object": "list","has_more": false,"data": [// Card layout objects...],}
object string, value is "list"The type of object returned.
data arrayAn array containing the card layout objects.
has_more booleanWhether or not there are more elements available after this set. If false, this set comprises the end of the list.
Get a card layout
curl https://api.recall.cards/v1/card_layouts/layout_yT9ktMcdzg4e \-u YOUR_API_KEY:
There are no parameters for this endpoint.
Returns
Returns the card layout object.
Delete a card layout
Deleting a card layout will also delete all its card layout fields.
curl https://api.recall.cards/v1/card_layouts/layout_yT9ktMcdzg4e \-u YOUR_API_KEY: \-X DELETE
There are no parameters for this endpoint.
Returns
Returns the deleted card layout object.
{"id": "layout_yT9ktMcdzg4e","object": "card_layout","deleted": true}